core-dev-tools 2.1.0__tar.gz → 2.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/PKG-INFO +1 -1
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools/__init__.py +1 -4
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools/cli/runner.py +5 -8
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools.egg-info/PKG-INFO +1 -1
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/pyproject.toml +1 -1
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/setup.py +0 -3
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/LICENSE +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/README.rst +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools/cli/__init__.py +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools/py.typed +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools.egg-info/SOURCES.txt +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools.egg-info/dependency_links.txt +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools.egg-info/requires.txt +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/core_dev_tools.egg-info/top_level.txt +0 -0
- {core_dev_tools-2.1.0 → core_dev_tools-2.1.1}/setup.cfg +0 -0
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""
|
|
4
2
|
Provides common tools used for development.
|
|
5
3
|
"""
|
|
6
4
|
|
|
7
|
-
from importlib.metadata import PackageNotFoundError
|
|
8
|
-
from importlib.metadata import version
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
9
6
|
|
|
10
7
|
try:
|
|
11
8
|
__version__ = version("core-dev-tools")
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
|
|
3
1
|
"""
|
|
4
2
|
This module provides a group of CLI commands that abstract linter, type
|
|
5
3
|
checker, and security tool execution. Consuming projects import ``cli_dev``
|
|
@@ -18,12 +16,11 @@ from __future__ import annotations
|
|
|
18
16
|
|
|
19
17
|
import subprocess # nosec B404
|
|
20
18
|
import sys
|
|
21
|
-
from typing import List, Tuple
|
|
22
19
|
|
|
23
20
|
from click import argument, echo, option
|
|
24
21
|
from click.decorators import group
|
|
25
22
|
|
|
26
|
-
LINTERS:
|
|
23
|
+
LINTERS: list[tuple[str, list[str]]] = [
|
|
27
24
|
("ty", ["ty", "check"]),
|
|
28
25
|
("ruff", ["ruff", "check"]),
|
|
29
26
|
("mypy", ["mypy", "--explicit-package-bases"]),
|
|
@@ -34,7 +31,7 @@ LINTERS: List[Tuple[str, List[str]]] = [
|
|
|
34
31
|
_LINTER_NAMES = [name for name, _ in LINTERS]
|
|
35
32
|
|
|
36
33
|
# Third element indicates whether the tool accepts a package path argument.
|
|
37
|
-
SECURITY_TOOLS:
|
|
34
|
+
SECURITY_TOOLS: list[tuple[str, list[str], bool]] = [
|
|
38
35
|
("bandit", ["bandit", "-r"], True),
|
|
39
36
|
("pip-audit", ["pip-audit"], False),
|
|
40
37
|
]
|
|
@@ -58,7 +55,7 @@ def cli_dev():
|
|
|
58
55
|
help="Run only the specified linter(s). Can be repeated. "
|
|
59
56
|
f"Available: {', '.join(_LINTER_NAMES)}. Defaults to all.",
|
|
60
57
|
)
|
|
61
|
-
def run_linters(package: str, tools:
|
|
58
|
+
def run_linters(package: str, tools: tuple[str, ...]) -> None:
|
|
62
59
|
"""
|
|
63
60
|
Runs linters and type checkers against PACKAGE.
|
|
64
61
|
|
|
@@ -87,7 +84,7 @@ def run_linters(package: str, tools: Tuple[str, ...]) -> None:
|
|
|
87
84
|
|
|
88
85
|
selected = [(name, cmd) for name, cmd in LINTERS if not tools or name in tools]
|
|
89
86
|
|
|
90
|
-
failed:
|
|
87
|
+
failed: list[str] = []
|
|
91
88
|
|
|
92
89
|
for name, base_cmd in selected:
|
|
93
90
|
echo(f"\n--- {name} ---")
|
|
@@ -119,7 +116,7 @@ def run_security(package: str) -> None:
|
|
|
119
116
|
reported at the end, then the command exits with code 1.
|
|
120
117
|
"""
|
|
121
118
|
|
|
122
|
-
failed:
|
|
119
|
+
failed: list[str] = []
|
|
123
120
|
|
|
124
121
|
for name, base_cmd, takes_path in SECURITY_TOOLS:
|
|
125
122
|
echo(f"\n--- {name} ---")
|
|
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
|
|
|
9
9
|
[project]
|
|
10
10
|
name = "core-dev-tools"
|
|
11
11
|
description = "This library provides common tools used for development..."
|
|
12
|
-
version = "2.1.
|
|
12
|
+
version = "2.1.1"
|
|
13
13
|
|
|
14
14
|
authors = [
|
|
15
15
|
{name = "Alejandro Cora González", email = "alek.cora.glez@gmail.com"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|