core-dev-tools 1.2.1__tar.gz → 2.1.0__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-1.2.1 → core_dev_tools-2.1.0}/PKG-INFO +102 -24
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/README.rst +99 -20
- core_dev_tools-2.1.0/core_dev_tools/__init__.py +19 -0
- core_dev_tools-2.1.0/core_dev_tools/cli/__init__.py +0 -0
- core_dev_tools-2.1.0/core_dev_tools/cli/runner.py +136 -0
- core_dev_tools-2.1.0/core_dev_tools/py.typed +0 -0
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/core_dev_tools.egg-info/PKG-INFO +102 -24
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/core_dev_tools.egg-info/SOURCES.txt +5 -1
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/core_dev_tools.egg-info/requires.txt +0 -2
- core_dev_tools-2.1.0/core_dev_tools.egg-info/top_level.txt +1 -0
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/pyproject.toml +3 -4
- core_dev_tools-1.2.1/core_dev_tools.egg-info/top_level.txt +0 -1
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/LICENSE +0 -0
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/core_dev_tools.egg-info/dependency_links.txt +0 -0
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/setup.cfg +0 -0
- {core_dev_tools-1.2.1 → core_dev_tools-2.1.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: core-dev-tools
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: This library provides common tools used for development...
|
|
5
5
|
Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
|
|
6
6
|
Maintainer: Alejandro Cora González
|
|
@@ -9,7 +9,7 @@ Project-URL: Homepage, https://gitlab.com/bytecode-solutions/core/core-dev-tools
|
|
|
9
9
|
Project-URL: Repository, https://gitlab.com/bytecode-solutions/core/core-dev-tools
|
|
10
10
|
Project-URL: Documentation, https://core-dev-tools.readthedocs.io/en/latest/
|
|
11
11
|
Project-URL: Issues, https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/issues
|
|
12
|
-
Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/
|
|
12
|
+
Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/main/CHANGELOG.md
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
15
15
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
@@ -23,6 +23,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
26
27
|
Requires-Python: >=3.9
|
|
27
28
|
Description-Content-Type: text/x-rst
|
|
28
29
|
License-File: LICENSE
|
|
@@ -38,12 +39,10 @@ Requires-Dist: pylint>=3.3.8
|
|
|
38
39
|
Requires-Dist: pytest>=8.4.0
|
|
39
40
|
Requires-Dist: pytest-cov>=7.0.0
|
|
40
41
|
Requires-Dist: pytest-xdist>=3.8.0
|
|
41
|
-
Requires-Dist: pydata-sphinx-theme>=0.16.1
|
|
42
42
|
Requires-Dist: pyright>=1.1.404
|
|
43
43
|
Requires-Dist: ruff>=0.12.11
|
|
44
44
|
Requires-Dist: setuptools>=61.0.0
|
|
45
45
|
Requires-Dist: Sphinx>=7.4.7
|
|
46
|
-
Requires-Dist: sphinx-copybutton>=0.5.2
|
|
47
46
|
Requires-Dist: types-setuptools>=62.6.1
|
|
48
47
|
Requires-Dist: taskipy>=1.14.1
|
|
49
48
|
Requires-Dist: tox>=4.29.0
|
|
@@ -56,12 +55,35 @@ Dynamic: license-file
|
|
|
56
55
|
core-dev-tools
|
|
57
56
|
===============================================================================
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
``core-dev-tools`` is a Python meta-package that centralizes the standard
|
|
59
|
+
development toolchain for the entire ecosystem. Instead of each
|
|
60
|
+
project independently declaring and versioning its own development tools,
|
|
61
|
+
every project installs this single package and immediately has access to the
|
|
62
|
+
full, curated set of tools.
|
|
63
|
+
|
|
64
|
+
There is no Python source code, the value of this package is entirely in
|
|
65
|
+
its curated dependency list. A single ``pip install core-dev-tools`` is enough
|
|
66
|
+
to equip any project or CI/CD pipeline with tools for:
|
|
67
|
+
|
|
68
|
+
* **Testing** — pytest, pytest-cov, pytest-xdist, coverage, tox
|
|
69
|
+
* **Linting & formatting** — Ruff, Pylint
|
|
70
|
+
* **Type checking** — Mypy, Pyright, ty
|
|
71
|
+
* **Security & compliance** — Bandit (``bandit --check``), pip-audit
|
|
72
|
+
* **Packaging & publishing** — Build, Twine
|
|
73
|
+
* **Pre-commit hooks** — pre-commit
|
|
74
|
+
* **Documentation** — Sphinx
|
|
75
|
+
* **Task automation** — taskipy, UV
|
|
76
|
+
* **Configuration** — click, environs
|
|
77
|
+
|
|
78
|
+
This ensures consistent, version-controlled tooling across every project in
|
|
79
|
+
the ecosystem without any per-project duplication.
|
|
62
80
|
|
|
63
81
|
===============================================================================
|
|
64
82
|
|
|
83
|
+
.. image:: https://static.pepy.tech/personalized-badge/core-dev-tools?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
|
|
84
|
+
:target: https://pepy.tech/projects/core-dev-tools
|
|
85
|
+
:alt: PyPI Downloads
|
|
86
|
+
|
|
65
87
|
.. image:: https://img.shields.io/pypi/pyversions/core-dev-tools.svg
|
|
66
88
|
:target: https://pypi.org/project/core-dev-tools/
|
|
67
89
|
:alt: Python Versions
|
|
@@ -93,18 +115,86 @@ Install from PyPI using pip:
|
|
|
93
115
|
.. code-block:: bash
|
|
94
116
|
|
|
95
117
|
pip install core-dev-tools
|
|
96
|
-
uv pip install core-
|
|
118
|
+
uv pip install core-dev-tools # Or using UV...
|
|
97
119
|
|
|
98
120
|
|
|
99
121
|
Getting Started
|
|
100
122
|
===============================================================================
|
|
101
123
|
|
|
102
|
-
|
|
103
|
-
|
|
124
|
+
Install once per project or environment, all tools are immediately available
|
|
125
|
+
on the ``PATH``:
|
|
126
|
+
|
|
127
|
+
.. code-block:: bash
|
|
128
|
+
|
|
129
|
+
ruff check . # Lint
|
|
130
|
+
mypy . # Type check
|
|
131
|
+
bandit -r . # Security scan
|
|
132
|
+
pytest -n auto --cov=. # Tests with parallel execution and coverage
|
|
133
|
+
pip-audit # Dependency vulnerability scan
|
|
104
134
|
|
|
105
135
|
For detailed documentation, visit: https://core-dev-tools.readthedocs.io/
|
|
106
136
|
|
|
107
137
|
|
|
138
|
+
Development
|
|
139
|
+
===============================================================================
|
|
140
|
+
|
|
141
|
+
**Run the test suite:**
|
|
142
|
+
|
|
143
|
+
.. code-block:: bash
|
|
144
|
+
|
|
145
|
+
python -m unittest discover -v tests/unit
|
|
146
|
+
|
|
147
|
+
**Run tests with coverage report:**
|
|
148
|
+
|
|
149
|
+
.. code-block:: bash
|
|
150
|
+
|
|
151
|
+
coverage run -m unittest discover tests/unit
|
|
152
|
+
coverage report -m # Terminal summary
|
|
153
|
+
coverage html # HTML report in htmlcov/
|
|
154
|
+
|
|
155
|
+
**Run linters against the package:**
|
|
156
|
+
|
|
157
|
+
.. code-block:: bash
|
|
158
|
+
|
|
159
|
+
python manager.py run-linters core_dev_tools
|
|
160
|
+
python manager.py run-linters core_dev_tools --tool ruff --tool mypy # Specific tools only
|
|
161
|
+
|
|
162
|
+
**Run security scanners against the package:**
|
|
163
|
+
|
|
164
|
+
.. code-block:: bash
|
|
165
|
+
|
|
166
|
+
python manager.py run-security core_dev_tools
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
CI/CD Usage
|
|
170
|
+
===============================================================================
|
|
171
|
+
|
|
172
|
+
The primary motivation for this package is CI/CD pipelines. Rather than
|
|
173
|
+
listing every tool in each project's pipeline configuration, simply install
|
|
174
|
+
``core-dev-tools`` at the start of the pipeline:
|
|
175
|
+
|
|
176
|
+
.. code-block:: yaml
|
|
177
|
+
|
|
178
|
+
# Example GitLab CI / GitHub Actions step
|
|
179
|
+
- pip install core-dev-tools
|
|
180
|
+
|
|
181
|
+
Then run the tools you need in subsequent steps:
|
|
182
|
+
|
|
183
|
+
.. code-block:: bash
|
|
184
|
+
|
|
185
|
+
ruff check . # Enforce code style
|
|
186
|
+
pylint src/ # Static analysis
|
|
187
|
+
mypy src/ # Type checking
|
|
188
|
+
bandit -r src/ # Security compliance
|
|
189
|
+
pip-audit # CVE scan on dependencies
|
|
190
|
+
pytest -n auto --cov=src/ # Run test suite with coverage
|
|
191
|
+
tox # Multi-environment testing
|
|
192
|
+
|
|
193
|
+
Updating tool versions for the entire ecosystem is a single change in
|
|
194
|
+
this package's ``pyproject.toml``, every downstream project picks it up
|
|
195
|
+
on their next install.
|
|
196
|
+
|
|
197
|
+
|
|
108
198
|
Available Tools
|
|
109
199
|
===============================================================================
|
|
110
200
|
|
|
@@ -208,7 +298,7 @@ More information: https://click.palletsprojects.com/
|
|
|
208
298
|
|
|
209
299
|
coverage
|
|
210
300
|
-------------------------------------------------------------------------------
|
|
211
|
-
coverage
|
|
301
|
+
`coverage` measures code coverage of Python programs. It monitors which
|
|
212
302
|
lines of your program are executed and which are not, making it easy to
|
|
213
303
|
identify untested code.
|
|
214
304
|
|
|
@@ -339,18 +429,6 @@ More information: https://pypi.org/project/taskipy/
|
|
|
339
429
|
task <task-name>
|
|
340
430
|
|
|
341
431
|
|
|
342
|
-
sphinx-copybutton
|
|
343
|
-
-------------------------------------------------------------------------------
|
|
344
|
-
sphinx-copybutton adds a small "copy" button to all code blocks in
|
|
345
|
-
Sphinx documentation, allowing readers to copy code snippets with a
|
|
346
|
-
single click.
|
|
347
|
-
|
|
348
|
-
More information: https://sphinx-copybutton.readthedocs.io/
|
|
349
|
-
|
|
350
|
-
No CLI usage — enabled by adding ``sphinx_copybutton`` to ``extensions``
|
|
351
|
-
in ``docs/conf.py``.
|
|
352
|
-
|
|
353
|
-
|
|
354
432
|
Sphinx
|
|
355
433
|
-------------------------------------------------------------------------------
|
|
356
434
|
Sphinx makes it easy to create intelligent and beautiful documentation.
|
|
@@ -432,7 +510,7 @@ Links
|
|
|
432
510
|
* **Documentation:** https://core-dev-tools.readthedocs.io/en/latest/
|
|
433
511
|
* **Repository:** https://gitlab.com/bytecode-solutions/core/core-dev-tools
|
|
434
512
|
* **Issues:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/issues
|
|
435
|
-
* **Changelog:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/
|
|
513
|
+
* **Changelog:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/main/CHANGELOG.md
|
|
436
514
|
* **PyPI:** https://pypi.org/project/core-dev-tools/
|
|
437
515
|
|
|
438
516
|
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
core-dev-tools
|
|
2
2
|
===============================================================================
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
``core-dev-tools`` is a Python meta-package that centralizes the standard
|
|
5
|
+
development toolchain for the entire ecosystem. Instead of each
|
|
6
|
+
project independently declaring and versioning its own development tools,
|
|
7
|
+
every project installs this single package and immediately has access to the
|
|
8
|
+
full, curated set of tools.
|
|
9
|
+
|
|
10
|
+
There is no Python source code, the value of this package is entirely in
|
|
11
|
+
its curated dependency list. A single ``pip install core-dev-tools`` is enough
|
|
12
|
+
to equip any project or CI/CD pipeline with tools for:
|
|
13
|
+
|
|
14
|
+
* **Testing** — pytest, pytest-cov, pytest-xdist, coverage, tox
|
|
15
|
+
* **Linting & formatting** — Ruff, Pylint
|
|
16
|
+
* **Type checking** — Mypy, Pyright, ty
|
|
17
|
+
* **Security & compliance** — Bandit (``bandit --check``), pip-audit
|
|
18
|
+
* **Packaging & publishing** — Build, Twine
|
|
19
|
+
* **Pre-commit hooks** — pre-commit
|
|
20
|
+
* **Documentation** — Sphinx
|
|
21
|
+
* **Task automation** — taskipy, UV
|
|
22
|
+
* **Configuration** — click, environs
|
|
23
|
+
|
|
24
|
+
This ensures consistent, version-controlled tooling across every project in
|
|
25
|
+
the ecosystem without any per-project duplication.
|
|
7
26
|
|
|
8
27
|
===============================================================================
|
|
9
28
|
|
|
29
|
+
.. image:: https://static.pepy.tech/personalized-badge/core-dev-tools?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
|
|
30
|
+
:target: https://pepy.tech/projects/core-dev-tools
|
|
31
|
+
:alt: PyPI Downloads
|
|
32
|
+
|
|
10
33
|
.. image:: https://img.shields.io/pypi/pyversions/core-dev-tools.svg
|
|
11
34
|
:target: https://pypi.org/project/core-dev-tools/
|
|
12
35
|
:alt: Python Versions
|
|
@@ -38,18 +61,86 @@ Install from PyPI using pip:
|
|
|
38
61
|
.. code-block:: bash
|
|
39
62
|
|
|
40
63
|
pip install core-dev-tools
|
|
41
|
-
uv pip install core-
|
|
64
|
+
uv pip install core-dev-tools # Or using UV...
|
|
42
65
|
|
|
43
66
|
|
|
44
67
|
Getting Started
|
|
45
68
|
===============================================================================
|
|
46
69
|
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
Install once per project or environment, all tools are immediately available
|
|
71
|
+
on the ``PATH``:
|
|
72
|
+
|
|
73
|
+
.. code-block:: bash
|
|
74
|
+
|
|
75
|
+
ruff check . # Lint
|
|
76
|
+
mypy . # Type check
|
|
77
|
+
bandit -r . # Security scan
|
|
78
|
+
pytest -n auto --cov=. # Tests with parallel execution and coverage
|
|
79
|
+
pip-audit # Dependency vulnerability scan
|
|
49
80
|
|
|
50
81
|
For detailed documentation, visit: https://core-dev-tools.readthedocs.io/
|
|
51
82
|
|
|
52
83
|
|
|
84
|
+
Development
|
|
85
|
+
===============================================================================
|
|
86
|
+
|
|
87
|
+
**Run the test suite:**
|
|
88
|
+
|
|
89
|
+
.. code-block:: bash
|
|
90
|
+
|
|
91
|
+
python -m unittest discover -v tests/unit
|
|
92
|
+
|
|
93
|
+
**Run tests with coverage report:**
|
|
94
|
+
|
|
95
|
+
.. code-block:: bash
|
|
96
|
+
|
|
97
|
+
coverage run -m unittest discover tests/unit
|
|
98
|
+
coverage report -m # Terminal summary
|
|
99
|
+
coverage html # HTML report in htmlcov/
|
|
100
|
+
|
|
101
|
+
**Run linters against the package:**
|
|
102
|
+
|
|
103
|
+
.. code-block:: bash
|
|
104
|
+
|
|
105
|
+
python manager.py run-linters core_dev_tools
|
|
106
|
+
python manager.py run-linters core_dev_tools --tool ruff --tool mypy # Specific tools only
|
|
107
|
+
|
|
108
|
+
**Run security scanners against the package:**
|
|
109
|
+
|
|
110
|
+
.. code-block:: bash
|
|
111
|
+
|
|
112
|
+
python manager.py run-security core_dev_tools
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
CI/CD Usage
|
|
116
|
+
===============================================================================
|
|
117
|
+
|
|
118
|
+
The primary motivation for this package is CI/CD pipelines. Rather than
|
|
119
|
+
listing every tool in each project's pipeline configuration, simply install
|
|
120
|
+
``core-dev-tools`` at the start of the pipeline:
|
|
121
|
+
|
|
122
|
+
.. code-block:: yaml
|
|
123
|
+
|
|
124
|
+
# Example GitLab CI / GitHub Actions step
|
|
125
|
+
- pip install core-dev-tools
|
|
126
|
+
|
|
127
|
+
Then run the tools you need in subsequent steps:
|
|
128
|
+
|
|
129
|
+
.. code-block:: bash
|
|
130
|
+
|
|
131
|
+
ruff check . # Enforce code style
|
|
132
|
+
pylint src/ # Static analysis
|
|
133
|
+
mypy src/ # Type checking
|
|
134
|
+
bandit -r src/ # Security compliance
|
|
135
|
+
pip-audit # CVE scan on dependencies
|
|
136
|
+
pytest -n auto --cov=src/ # Run test suite with coverage
|
|
137
|
+
tox # Multi-environment testing
|
|
138
|
+
|
|
139
|
+
Updating tool versions for the entire ecosystem is a single change in
|
|
140
|
+
this package's ``pyproject.toml``, every downstream project picks it up
|
|
141
|
+
on their next install.
|
|
142
|
+
|
|
143
|
+
|
|
53
144
|
Available Tools
|
|
54
145
|
===============================================================================
|
|
55
146
|
|
|
@@ -153,7 +244,7 @@ More information: https://click.palletsprojects.com/
|
|
|
153
244
|
|
|
154
245
|
coverage
|
|
155
246
|
-------------------------------------------------------------------------------
|
|
156
|
-
coverage
|
|
247
|
+
`coverage` measures code coverage of Python programs. It monitors which
|
|
157
248
|
lines of your program are executed and which are not, making it easy to
|
|
158
249
|
identify untested code.
|
|
159
250
|
|
|
@@ -284,18 +375,6 @@ More information: https://pypi.org/project/taskipy/
|
|
|
284
375
|
task <task-name>
|
|
285
376
|
|
|
286
377
|
|
|
287
|
-
sphinx-copybutton
|
|
288
|
-
-------------------------------------------------------------------------------
|
|
289
|
-
sphinx-copybutton adds a small "copy" button to all code blocks in
|
|
290
|
-
Sphinx documentation, allowing readers to copy code snippets with a
|
|
291
|
-
single click.
|
|
292
|
-
|
|
293
|
-
More information: https://sphinx-copybutton.readthedocs.io/
|
|
294
|
-
|
|
295
|
-
No CLI usage — enabled by adding ``sphinx_copybutton`` to ``extensions``
|
|
296
|
-
in ``docs/conf.py``.
|
|
297
|
-
|
|
298
|
-
|
|
299
378
|
Sphinx
|
|
300
379
|
-------------------------------------------------------------------------------
|
|
301
380
|
Sphinx makes it easy to create intelligent and beautiful documentation.
|
|
@@ -377,7 +456,7 @@ Links
|
|
|
377
456
|
* **Documentation:** https://core-dev-tools.readthedocs.io/en/latest/
|
|
378
457
|
* **Repository:** https://gitlab.com/bytecode-solutions/core/core-dev-tools
|
|
379
458
|
* **Issues:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/issues
|
|
380
|
-
* **Changelog:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/
|
|
459
|
+
* **Changelog:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/main/CHANGELOG.md
|
|
381
460
|
* **PyPI:** https://pypi.org/project/core-dev-tools/
|
|
382
461
|
|
|
383
462
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Provides common tools used for development.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from importlib.metadata import PackageNotFoundError
|
|
8
|
+
from importlib.metadata import version
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
__version__ = version("core-dev-tools")
|
|
12
|
+
|
|
13
|
+
except PackageNotFoundError:
|
|
14
|
+
__version__ = "unknown"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"__version__",
|
|
19
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
This module provides a group of CLI commands that abstract linter, type
|
|
5
|
+
checker, and security tool execution. Consuming projects import ``cli_dev``
|
|
6
|
+
and wire it into their own ``CommandCollection`` to expose ``run-linters`` and
|
|
7
|
+
``run-security`` without duplicating this logic.
|
|
8
|
+
|
|
9
|
+
**Available Commands:**
|
|
10
|
+
|
|
11
|
+
* ``python manager.py run-linters <package>``
|
|
12
|
+
* ``python manager.py run-linters core_dev_tools --tool ruff``
|
|
13
|
+
* ``python manager.py run-linters core_dev_tools --tool mypy --tool pyright``
|
|
14
|
+
* ``python manager.py run-security <package>``
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import subprocess # nosec B404
|
|
20
|
+
import sys
|
|
21
|
+
from typing import List, Tuple
|
|
22
|
+
|
|
23
|
+
from click import argument, echo, option
|
|
24
|
+
from click.decorators import group
|
|
25
|
+
|
|
26
|
+
LINTERS: List[Tuple[str, List[str]]] = [
|
|
27
|
+
("ty", ["ty", "check"]),
|
|
28
|
+
("ruff", ["ruff", "check"]),
|
|
29
|
+
("mypy", ["mypy", "--explicit-package-bases"]),
|
|
30
|
+
("pyright", ["pyright"]),
|
|
31
|
+
("pylint", ["pylint"]),
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
_LINTER_NAMES = [name for name, _ in LINTERS]
|
|
35
|
+
|
|
36
|
+
# Third element indicates whether the tool accepts a package path argument.
|
|
37
|
+
SECURITY_TOOLS: List[Tuple[str, List[str], bool]] = [
|
|
38
|
+
("bandit", ["bandit", "-r"], True),
|
|
39
|
+
("pip-audit", ["pip-audit"], False),
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@group()
|
|
44
|
+
def cli_dev():
|
|
45
|
+
"""
|
|
46
|
+
Group of commands related to linters and type checkers.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@cli_dev.command("run-linters")
|
|
51
|
+
@argument("package")
|
|
52
|
+
@option(
|
|
53
|
+
"-t",
|
|
54
|
+
"--tool",
|
|
55
|
+
"tools",
|
|
56
|
+
multiple=True,
|
|
57
|
+
type=str,
|
|
58
|
+
help="Run only the specified linter(s). Can be repeated. "
|
|
59
|
+
f"Available: {', '.join(_LINTER_NAMES)}. Defaults to all.",
|
|
60
|
+
)
|
|
61
|
+
def run_linters(package: str, tools: Tuple[str, ...]) -> None:
|
|
62
|
+
"""
|
|
63
|
+
Runs linters and type checkers against PACKAGE.
|
|
64
|
+
|
|
65
|
+
:param package: Root package directory to check (e.g. ``core_dev_tools``).
|
|
66
|
+
:param tools: Subset of linters to run. When omitted, all linters run.
|
|
67
|
+
|
|
68
|
+
By default, runs all five tools in order:
|
|
69
|
+
- ty check
|
|
70
|
+
- ruff check
|
|
71
|
+
- mypy
|
|
72
|
+
- pyright
|
|
73
|
+
- pylint
|
|
74
|
+
|
|
75
|
+
All linters always run; a non-zero exit from any tool is collected and
|
|
76
|
+
reported at the end, then the command exits with code 1.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
invalid = set(tools) - set(_LINTER_NAMES)
|
|
80
|
+
if invalid:
|
|
81
|
+
echo(
|
|
82
|
+
f"Unknown linter(s): {', '.join(sorted(invalid))}. "
|
|
83
|
+
f"Available: {', '.join(_LINTER_NAMES)}",
|
|
84
|
+
err=True,
|
|
85
|
+
)
|
|
86
|
+
sys.exit(1)
|
|
87
|
+
|
|
88
|
+
selected = [(name, cmd) for name, cmd in LINTERS if not tools or name in tools]
|
|
89
|
+
|
|
90
|
+
failed: List[str] = []
|
|
91
|
+
|
|
92
|
+
for name, base_cmd in selected:
|
|
93
|
+
echo(f"\n--- {name} ---")
|
|
94
|
+
result = subprocess.run(base_cmd + [package], check=False) # nosec B603
|
|
95
|
+
if result.returncode != 0:
|
|
96
|
+
failed.append(name)
|
|
97
|
+
|
|
98
|
+
echo("")
|
|
99
|
+
if failed:
|
|
100
|
+
echo(f"Linters failed: {', '.join(failed)}", err=True)
|
|
101
|
+
sys.exit(1)
|
|
102
|
+
|
|
103
|
+
echo("All linters passed.")
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@cli_dev.command("run-security")
|
|
107
|
+
@argument("package")
|
|
108
|
+
def run_security(package: str) -> None:
|
|
109
|
+
"""
|
|
110
|
+
Runs security scanners against PACKAGE.
|
|
111
|
+
|
|
112
|
+
:param package: Root package directory to scan (e.g. ``core_dev_tools``).
|
|
113
|
+
|
|
114
|
+
Runs in order:
|
|
115
|
+
- bandit -r <package>
|
|
116
|
+
- pip-audit
|
|
117
|
+
|
|
118
|
+
All tools always run; a non-zero exit from any tool is collected and
|
|
119
|
+
reported at the end, then the command exits with code 1.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
failed: List[str] = []
|
|
123
|
+
|
|
124
|
+
for name, base_cmd, takes_path in SECURITY_TOOLS:
|
|
125
|
+
echo(f"\n--- {name} ---")
|
|
126
|
+
cmd = base_cmd + ([package] if takes_path else [])
|
|
127
|
+
result = subprocess.run(cmd, check=False) # nosec B603
|
|
128
|
+
if result.returncode != 0:
|
|
129
|
+
failed.append(name)
|
|
130
|
+
|
|
131
|
+
echo("")
|
|
132
|
+
if failed:
|
|
133
|
+
echo(f"Security tools failed: {', '.join(failed)}", err=True)
|
|
134
|
+
sys.exit(1)
|
|
135
|
+
|
|
136
|
+
echo("All security checks passed.")
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: core-dev-tools
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: This library provides common tools used for development...
|
|
5
5
|
Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
|
|
6
6
|
Maintainer: Alejandro Cora González
|
|
@@ -9,7 +9,7 @@ Project-URL: Homepage, https://gitlab.com/bytecode-solutions/core/core-dev-tools
|
|
|
9
9
|
Project-URL: Repository, https://gitlab.com/bytecode-solutions/core/core-dev-tools
|
|
10
10
|
Project-URL: Documentation, https://core-dev-tools.readthedocs.io/en/latest/
|
|
11
11
|
Project-URL: Issues, https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/issues
|
|
12
|
-
Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/
|
|
12
|
+
Project-URL: Changelog, https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/main/CHANGELOG.md
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
15
15
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
@@ -23,6 +23,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
25
25
|
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
26
27
|
Requires-Python: >=3.9
|
|
27
28
|
Description-Content-Type: text/x-rst
|
|
28
29
|
License-File: LICENSE
|
|
@@ -38,12 +39,10 @@ Requires-Dist: pylint>=3.3.8
|
|
|
38
39
|
Requires-Dist: pytest>=8.4.0
|
|
39
40
|
Requires-Dist: pytest-cov>=7.0.0
|
|
40
41
|
Requires-Dist: pytest-xdist>=3.8.0
|
|
41
|
-
Requires-Dist: pydata-sphinx-theme>=0.16.1
|
|
42
42
|
Requires-Dist: pyright>=1.1.404
|
|
43
43
|
Requires-Dist: ruff>=0.12.11
|
|
44
44
|
Requires-Dist: setuptools>=61.0.0
|
|
45
45
|
Requires-Dist: Sphinx>=7.4.7
|
|
46
|
-
Requires-Dist: sphinx-copybutton>=0.5.2
|
|
47
46
|
Requires-Dist: types-setuptools>=62.6.1
|
|
48
47
|
Requires-Dist: taskipy>=1.14.1
|
|
49
48
|
Requires-Dist: tox>=4.29.0
|
|
@@ -56,12 +55,35 @@ Dynamic: license-file
|
|
|
56
55
|
core-dev-tools
|
|
57
56
|
===============================================================================
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
``core-dev-tools`` is a Python meta-package that centralizes the standard
|
|
59
|
+
development toolchain for the entire ecosystem. Instead of each
|
|
60
|
+
project independently declaring and versioning its own development tools,
|
|
61
|
+
every project installs this single package and immediately has access to the
|
|
62
|
+
full, curated set of tools.
|
|
63
|
+
|
|
64
|
+
There is no Python source code, the value of this package is entirely in
|
|
65
|
+
its curated dependency list. A single ``pip install core-dev-tools`` is enough
|
|
66
|
+
to equip any project or CI/CD pipeline with tools for:
|
|
67
|
+
|
|
68
|
+
* **Testing** — pytest, pytest-cov, pytest-xdist, coverage, tox
|
|
69
|
+
* **Linting & formatting** — Ruff, Pylint
|
|
70
|
+
* **Type checking** — Mypy, Pyright, ty
|
|
71
|
+
* **Security & compliance** — Bandit (``bandit --check``), pip-audit
|
|
72
|
+
* **Packaging & publishing** — Build, Twine
|
|
73
|
+
* **Pre-commit hooks** — pre-commit
|
|
74
|
+
* **Documentation** — Sphinx
|
|
75
|
+
* **Task automation** — taskipy, UV
|
|
76
|
+
* **Configuration** — click, environs
|
|
77
|
+
|
|
78
|
+
This ensures consistent, version-controlled tooling across every project in
|
|
79
|
+
the ecosystem without any per-project duplication.
|
|
62
80
|
|
|
63
81
|
===============================================================================
|
|
64
82
|
|
|
83
|
+
.. image:: https://static.pepy.tech/personalized-badge/core-dev-tools?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
|
|
84
|
+
:target: https://pepy.tech/projects/core-dev-tools
|
|
85
|
+
:alt: PyPI Downloads
|
|
86
|
+
|
|
65
87
|
.. image:: https://img.shields.io/pypi/pyversions/core-dev-tools.svg
|
|
66
88
|
:target: https://pypi.org/project/core-dev-tools/
|
|
67
89
|
:alt: Python Versions
|
|
@@ -93,18 +115,86 @@ Install from PyPI using pip:
|
|
|
93
115
|
.. code-block:: bash
|
|
94
116
|
|
|
95
117
|
pip install core-dev-tools
|
|
96
|
-
uv pip install core-
|
|
118
|
+
uv pip install core-dev-tools # Or using UV...
|
|
97
119
|
|
|
98
120
|
|
|
99
121
|
Getting Started
|
|
100
122
|
===============================================================================
|
|
101
123
|
|
|
102
|
-
|
|
103
|
-
|
|
124
|
+
Install once per project or environment, all tools are immediately available
|
|
125
|
+
on the ``PATH``:
|
|
126
|
+
|
|
127
|
+
.. code-block:: bash
|
|
128
|
+
|
|
129
|
+
ruff check . # Lint
|
|
130
|
+
mypy . # Type check
|
|
131
|
+
bandit -r . # Security scan
|
|
132
|
+
pytest -n auto --cov=. # Tests with parallel execution and coverage
|
|
133
|
+
pip-audit # Dependency vulnerability scan
|
|
104
134
|
|
|
105
135
|
For detailed documentation, visit: https://core-dev-tools.readthedocs.io/
|
|
106
136
|
|
|
107
137
|
|
|
138
|
+
Development
|
|
139
|
+
===============================================================================
|
|
140
|
+
|
|
141
|
+
**Run the test suite:**
|
|
142
|
+
|
|
143
|
+
.. code-block:: bash
|
|
144
|
+
|
|
145
|
+
python -m unittest discover -v tests/unit
|
|
146
|
+
|
|
147
|
+
**Run tests with coverage report:**
|
|
148
|
+
|
|
149
|
+
.. code-block:: bash
|
|
150
|
+
|
|
151
|
+
coverage run -m unittest discover tests/unit
|
|
152
|
+
coverage report -m # Terminal summary
|
|
153
|
+
coverage html # HTML report in htmlcov/
|
|
154
|
+
|
|
155
|
+
**Run linters against the package:**
|
|
156
|
+
|
|
157
|
+
.. code-block:: bash
|
|
158
|
+
|
|
159
|
+
python manager.py run-linters core_dev_tools
|
|
160
|
+
python manager.py run-linters core_dev_tools --tool ruff --tool mypy # Specific tools only
|
|
161
|
+
|
|
162
|
+
**Run security scanners against the package:**
|
|
163
|
+
|
|
164
|
+
.. code-block:: bash
|
|
165
|
+
|
|
166
|
+
python manager.py run-security core_dev_tools
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
CI/CD Usage
|
|
170
|
+
===============================================================================
|
|
171
|
+
|
|
172
|
+
The primary motivation for this package is CI/CD pipelines. Rather than
|
|
173
|
+
listing every tool in each project's pipeline configuration, simply install
|
|
174
|
+
``core-dev-tools`` at the start of the pipeline:
|
|
175
|
+
|
|
176
|
+
.. code-block:: yaml
|
|
177
|
+
|
|
178
|
+
# Example GitLab CI / GitHub Actions step
|
|
179
|
+
- pip install core-dev-tools
|
|
180
|
+
|
|
181
|
+
Then run the tools you need in subsequent steps:
|
|
182
|
+
|
|
183
|
+
.. code-block:: bash
|
|
184
|
+
|
|
185
|
+
ruff check . # Enforce code style
|
|
186
|
+
pylint src/ # Static analysis
|
|
187
|
+
mypy src/ # Type checking
|
|
188
|
+
bandit -r src/ # Security compliance
|
|
189
|
+
pip-audit # CVE scan on dependencies
|
|
190
|
+
pytest -n auto --cov=src/ # Run test suite with coverage
|
|
191
|
+
tox # Multi-environment testing
|
|
192
|
+
|
|
193
|
+
Updating tool versions for the entire ecosystem is a single change in
|
|
194
|
+
this package's ``pyproject.toml``, every downstream project picks it up
|
|
195
|
+
on their next install.
|
|
196
|
+
|
|
197
|
+
|
|
108
198
|
Available Tools
|
|
109
199
|
===============================================================================
|
|
110
200
|
|
|
@@ -208,7 +298,7 @@ More information: https://click.palletsprojects.com/
|
|
|
208
298
|
|
|
209
299
|
coverage
|
|
210
300
|
-------------------------------------------------------------------------------
|
|
211
|
-
coverage
|
|
301
|
+
`coverage` measures code coverage of Python programs. It monitors which
|
|
212
302
|
lines of your program are executed and which are not, making it easy to
|
|
213
303
|
identify untested code.
|
|
214
304
|
|
|
@@ -339,18 +429,6 @@ More information: https://pypi.org/project/taskipy/
|
|
|
339
429
|
task <task-name>
|
|
340
430
|
|
|
341
431
|
|
|
342
|
-
sphinx-copybutton
|
|
343
|
-
-------------------------------------------------------------------------------
|
|
344
|
-
sphinx-copybutton adds a small "copy" button to all code blocks in
|
|
345
|
-
Sphinx documentation, allowing readers to copy code snippets with a
|
|
346
|
-
single click.
|
|
347
|
-
|
|
348
|
-
More information: https://sphinx-copybutton.readthedocs.io/
|
|
349
|
-
|
|
350
|
-
No CLI usage — enabled by adding ``sphinx_copybutton`` to ``extensions``
|
|
351
|
-
in ``docs/conf.py``.
|
|
352
|
-
|
|
353
|
-
|
|
354
432
|
Sphinx
|
|
355
433
|
-------------------------------------------------------------------------------
|
|
356
434
|
Sphinx makes it easy to create intelligent and beautiful documentation.
|
|
@@ -432,7 +510,7 @@ Links
|
|
|
432
510
|
* **Documentation:** https://core-dev-tools.readthedocs.io/en/latest/
|
|
433
511
|
* **Repository:** https://gitlab.com/bytecode-solutions/core/core-dev-tools
|
|
434
512
|
* **Issues:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/issues
|
|
435
|
-
* **Changelog:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/
|
|
513
|
+
* **Changelog:** https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/main/CHANGELOG.md
|
|
436
514
|
* **PyPI:** https://pypi.org/project/core-dev-tools/
|
|
437
515
|
|
|
438
516
|
|
|
@@ -2,8 +2,12 @@ LICENSE
|
|
|
2
2
|
README.rst
|
|
3
3
|
pyproject.toml
|
|
4
4
|
setup.py
|
|
5
|
+
core_dev_tools/__init__.py
|
|
6
|
+
core_dev_tools/py.typed
|
|
5
7
|
core_dev_tools.egg-info/PKG-INFO
|
|
6
8
|
core_dev_tools.egg-info/SOURCES.txt
|
|
7
9
|
core_dev_tools.egg-info/dependency_links.txt
|
|
8
10
|
core_dev_tools.egg-info/requires.txt
|
|
9
|
-
core_dev_tools.egg-info/top_level.txt
|
|
11
|
+
core_dev_tools.egg-info/top_level.txt
|
|
12
|
+
core_dev_tools/cli/__init__.py
|
|
13
|
+
core_dev_tools/cli/runner.py
|
|
@@ -10,12 +10,10 @@ pylint>=3.3.8
|
|
|
10
10
|
pytest>=8.4.0
|
|
11
11
|
pytest-cov>=7.0.0
|
|
12
12
|
pytest-xdist>=3.8.0
|
|
13
|
-
pydata-sphinx-theme>=0.16.1
|
|
14
13
|
pyright>=1.1.404
|
|
15
14
|
ruff>=0.12.11
|
|
16
15
|
setuptools>=61.0.0
|
|
17
16
|
Sphinx>=7.4.7
|
|
18
|
-
sphinx-copybutton>=0.5.2
|
|
19
17
|
types-setuptools>=62.6.1
|
|
20
18
|
taskipy>=1.14.1
|
|
21
19
|
tox>=4.29.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
core_dev_tools
|
|
@@ -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 = "
|
|
12
|
+
version = "2.1.0"
|
|
13
13
|
|
|
14
14
|
authors = [
|
|
15
15
|
{name = "Alejandro Cora González", email = "alek.cora.glez@gmail.com"}
|
|
@@ -38,6 +38,7 @@ classifiers = [
|
|
|
38
38
|
"Programming Language :: Python :: 3.12",
|
|
39
39
|
"Programming Language :: Python :: 3.13",
|
|
40
40
|
"Programming Language :: Python :: 3.14",
|
|
41
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
41
42
|
]
|
|
42
43
|
|
|
43
44
|
dependencies = [
|
|
@@ -53,12 +54,10 @@ dependencies = [
|
|
|
53
54
|
"pytest>=8.4.0",
|
|
54
55
|
"pytest-cov>=7.0.0",
|
|
55
56
|
"pytest-xdist>=3.8.0",
|
|
56
|
-
"pydata-sphinx-theme>=0.16.1",
|
|
57
57
|
"pyright>=1.1.404",
|
|
58
58
|
"ruff>=0.12.11",
|
|
59
59
|
"setuptools>=61.0.0",
|
|
60
60
|
"Sphinx>=7.4.7",
|
|
61
|
-
"sphinx-copybutton>=0.5.2",
|
|
62
61
|
"types-setuptools>=62.6.1",
|
|
63
62
|
"taskipy>=1.14.1",
|
|
64
63
|
"tox>=4.29.0",
|
|
@@ -73,4 +72,4 @@ Homepage = "https://gitlab.com/bytecode-solutions/core/core-dev-tools"
|
|
|
73
72
|
Repository = "https://gitlab.com/bytecode-solutions/core/core-dev-tools"
|
|
74
73
|
Documentation = "https://core-dev-tools.readthedocs.io/en/latest/"
|
|
75
74
|
Issues = "https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/issues"
|
|
76
|
-
Changelog = "https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/
|
|
75
|
+
Changelog = "https://gitlab.com/bytecode-solutions/core/core-dev-tools/-/blob/main/CHANGELOG.md"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|