quickpub 4.1.1__tar.gz → 4.1.2__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.
- quickpub-4.1.2/PKG-INFO +232 -0
- quickpub-4.1.2/README.md +191 -0
- quickpub-4.1.2/pyproject.toml +148 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/__init__.py +1 -1
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/__main__.py +38 -16
- quickpub-4.1.2/quickpub/dist_files.py +33 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/files.py +50 -1
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/build_schemas/__init__.py +1 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/build_schemas/setuptools_build_schema.py +1 -5
- quickpub-4.1.2/quickpub/strategies/implementations/build_schemas/uv_build_schema.py +50 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/upload_targets/pypirc_upload_target.py +6 -2
- quickpub-4.1.2/quickpub.egg-info/PKG-INFO +232 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub.egg-info/SOURCES.txt +2 -0
- quickpub-4.1.1/PKG-INFO +0 -177
- quickpub-4.1.1/README.md +0 -136
- quickpub-4.1.1/pyproject.toml +0 -34
- quickpub-4.1.1/quickpub.egg-info/PKG-INFO +0 -177
- {quickpub-4.1.1 → quickpub-4.1.2}/LICENSE +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/MANIFEST.in +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/classifiers.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/enforcers.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/logging_.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/package_manager_detection.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/proxy.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/py.typed +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/qa.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/build_schema.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/constraint_enforcer.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/constraint_enforcers/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/constraint_enforcers/license_enforcer.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/constraint_enforcers/local_version_enforcer.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/constraint_enforcers/pypi_remote_version_enforcer.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/constraint_enforcers/pypirc_enforcer.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/constraint_enforcers/readme_enforcer.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/package_managers/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/package_managers/installed_package_parser.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/package_managers/pip_package_manager.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/package_managers/uv_package_manager.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/python_providers/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/python_providers/conda_python_provider.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/python_providers/default_python_provider.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/python_providers/union_provider.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/python_providers/uv_python_provider.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/quality_assurance_runners/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/quality_assurance_runners/mypy_qa_runner.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/quality_assurance_runners/pylint_qa_runner.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/quality_assurance_runners/pytest_qa_runner.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/quality_assurance_runners/unittest_qa_runner.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/upload_targets/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/implementations/upload_targets/github_upload_target.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/package_manager.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/python_provider.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/quality_assurance_runner.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/quickpub_strategy.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/strategies/upload_target.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/structures/__init__.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/structures/bound.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/structures/dependency.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/structures/version.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/validators.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub/worker_pool.py +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub.egg-info/dependency_links.txt +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub.egg-info/entry_points.txt +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub.egg-info/requires.txt +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/quickpub.egg-info/top_level.txt +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/setup.cfg +0 -0
- {quickpub-4.1.1 → quickpub-4.1.2}/setup.py +0 -0
quickpub-4.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quickpub
|
|
3
|
+
Version: 4.1.2
|
|
4
|
+
Summary: A local CI/CD simulation tool that runs quality checks, tests, and validations locally before publishing Python packages, ensuring higher build pass rates and faster feedback loops
|
|
5
|
+
Author-email: danielnachumdev <danielnachumdev@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2022 danielnachumdev
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
Project-URL: Homepage, https://github.com/danielnachumdev/quickpub
|
|
28
|
+
Project-URL: Bug Tracker, https://github.com/danielnachumdev/quickpub/issues
|
|
29
|
+
Classifier: Development Status :: 3 - Alpha
|
|
30
|
+
Classifier: Intended Audience :: Developers
|
|
31
|
+
Classifier: Programming Language :: Python :: 3
|
|
32
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
33
|
+
Requires-Python: >=3.8.0
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: danielutils>=1.1.23
|
|
37
|
+
Requires-Dist: requests
|
|
38
|
+
Requires-Dist: fire
|
|
39
|
+
Requires-Dist: twine
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# QuickPub
|
|
43
|
+
|
|
44
|
+
[](https://www.python.org/downloads/)
|
|
45
|
+
[](LICENSE)
|
|
46
|
+
|
|
47
|
+
Catch publish failures on your machine before they hit CI or PyPI.
|
|
48
|
+
|
|
49
|
+
QuickPub runs pre-publish checks, quality tools, tests, packaging, and upload in one pipeline — so broken releases fail locally with fast feedback.
|
|
50
|
+
|
|
51
|
+
## The problem
|
|
52
|
+
|
|
53
|
+
Publishing a Python package usually means juggling several steps: validate project files, run mypy/pylint/pytest, bump the version, generate packaging files, build the sdist, upload to PyPI. Miss a step and you find out in CI — or worse, after a bad release.
|
|
54
|
+
|
|
55
|
+
QuickPub wires those steps together. You define your package once; it enforces constraints, runs QA across Python environments, builds, and uploads.
|
|
56
|
+
|
|
57
|
+
## Install
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install quickpub
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
With [uv](https://docs.astral.sh/uv/):
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
uv add quickpub
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Requires Python **3.8+** (tested on 3.8–3.13).
|
|
70
|
+
|
|
71
|
+
## Quick start
|
|
72
|
+
|
|
73
|
+
Add a `publish.py` in your project root:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from quickpub import (
|
|
77
|
+
publish,
|
|
78
|
+
MypyRunner,
|
|
79
|
+
PylintRunner,
|
|
80
|
+
PytestRunner,
|
|
81
|
+
SetuptoolsBuildSchema,
|
|
82
|
+
PypircUploadTarget,
|
|
83
|
+
PypircEnforcer,
|
|
84
|
+
ReadmeEnforcer,
|
|
85
|
+
LicenseEnforcer,
|
|
86
|
+
LocalVersionEnforcer,
|
|
87
|
+
PypiRemoteVersionEnforcer,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
publish(
|
|
91
|
+
name="my-package",
|
|
92
|
+
version="1.0.0",
|
|
93
|
+
author="Your Name",
|
|
94
|
+
author_email="you@example.com",
|
|
95
|
+
description="My package",
|
|
96
|
+
homepage="https://github.com/you/my-package",
|
|
97
|
+
dependencies=["requests>=2.25.0"],
|
|
98
|
+
min_python="3.8.0",
|
|
99
|
+
enforcers=[
|
|
100
|
+
PypircEnforcer(),
|
|
101
|
+
ReadmeEnforcer(),
|
|
102
|
+
LicenseEnforcer(),
|
|
103
|
+
LocalVersionEnforcer(),
|
|
104
|
+
PypiRemoteVersionEnforcer(),
|
|
105
|
+
],
|
|
106
|
+
global_quality_assurance_runners=[
|
|
107
|
+
MypyRunner(bound="<=20"),
|
|
108
|
+
PylintRunner(bound=">=0.8"),
|
|
109
|
+
PytestRunner(bound=">=0.95"),
|
|
110
|
+
],
|
|
111
|
+
build_schemas=[SetuptoolsBuildSchema()],
|
|
112
|
+
upload_targets=[PypircUploadTarget()],
|
|
113
|
+
)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### uv / `pyproject.toml` projects (important)
|
|
117
|
+
|
|
118
|
+
If the project already has a PEP 621 `pyproject.toml` (uv, Hatch, Poetry, PDM), **do not** use the default file generation. `publish()` would overwrite `pyproject.toml` and wipe `[dependency-groups]`, `[tool.uv]`, `[tool.mypy]`, and other toolchain config.
|
|
119
|
+
|
|
120
|
+
Use `UvBuildSchema` and `generate_project_files=False`:
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
from quickpub import (
|
|
124
|
+
publish,
|
|
125
|
+
UvBuildSchema,
|
|
126
|
+
PypircUploadTarget,
|
|
127
|
+
PypircEnforcer,
|
|
128
|
+
ReadmeEnforcer,
|
|
129
|
+
LicenseEnforcer,
|
|
130
|
+
LocalVersionEnforcer,
|
|
131
|
+
PypiRemoteVersionEnforcer,
|
|
132
|
+
MypyRunner,
|
|
133
|
+
PylintRunner,
|
|
134
|
+
PytestRunner,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
publish(
|
|
138
|
+
name="my-package",
|
|
139
|
+
version="1.0.0",
|
|
140
|
+
author="Your Name",
|
|
141
|
+
author_email="you@example.com",
|
|
142
|
+
description="My package",
|
|
143
|
+
homepage="https://github.com/you/my-package",
|
|
144
|
+
dependencies=["requests>=2.25.0"],
|
|
145
|
+
min_python="3.8.0",
|
|
146
|
+
enforcers=[
|
|
147
|
+
PypircEnforcer(),
|
|
148
|
+
ReadmeEnforcer(),
|
|
149
|
+
LicenseEnforcer(),
|
|
150
|
+
LocalVersionEnforcer(),
|
|
151
|
+
PypiRemoteVersionEnforcer(),
|
|
152
|
+
],
|
|
153
|
+
global_quality_assurance_runners=[
|
|
154
|
+
MypyRunner(bound="<=20"),
|
|
155
|
+
PylintRunner(bound=">=0.8"),
|
|
156
|
+
PytestRunner(bound=">=0.95"),
|
|
157
|
+
],
|
|
158
|
+
build_schemas=[UvBuildSchema()],
|
|
159
|
+
generate_project_files=False,
|
|
160
|
+
upload_targets=[PypircUploadTarget()],
|
|
161
|
+
)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
That keeps the existing `pyproject.toml`, bumps only `[project].version` and `__init__.__version__`, and builds with `uv build`. See [this repo's `publish.py`](publish.py).
|
|
165
|
+
|
|
166
|
+
Run it:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
python publish.py
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Dry run** — validate and run QA without building or uploading:
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
publish(..., demo=True)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
PyPI upload needs a valid `.pypirc`. See [this repo's `publish.py`](publish.py) for a full working example.
|
|
179
|
+
|
|
180
|
+
## What runs
|
|
181
|
+
|
|
182
|
+
When you call `publish()`, QuickPub runs these stages in order:
|
|
183
|
+
|
|
184
|
+
1. **Enforcers** — checks README, LICENSE, `.pypirc`, and local/PyPI version consistency
|
|
185
|
+
2. **Quality assurance** — mypy, pylint, pytest, and unittest with configurable score bounds, in parallel across detected Python environments
|
|
186
|
+
3. **File generation** — by default writes `setup.py`, `pyproject.toml`, `MANIFEST.in`, and updates `__init__.py`. Pass `generate_project_files=False` to keep an existing `pyproject.toml` (only `[project].version` and `__init__.__version__` are updated).
|
|
187
|
+
4. **Build & upload** — builds the sdist (`SetuptoolsBuildSchema` or `UvBuildSchema`) and uploads via twine (and optionally pushes to GitHub)
|
|
188
|
+
|
|
189
|
+
Skip build and upload with `demo=True`.
|
|
190
|
+
|
|
191
|
+
## Environment detection
|
|
192
|
+
|
|
193
|
+
By default, QuickPub detects your toolchain from the project root:
|
|
194
|
+
|
|
195
|
+
| Project layout | Package manager | Python provider |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| `uv.lock` present | `UvPackageManager` | `UvPythonProvider` |
|
|
198
|
+
| otherwise | `PipPackageManager` | `DefaultPythonProvider` |
|
|
199
|
+
|
|
200
|
+
Override for conda or mixed setups:
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
from quickpub import CondaPythonProvider, UnionProvider
|
|
204
|
+
|
|
205
|
+
publish(
|
|
206
|
+
...,
|
|
207
|
+
python_interpreter_provider=UnionProvider([
|
|
208
|
+
CondaPythonProvider(["base", "py39", "py38"]),
|
|
209
|
+
]),
|
|
210
|
+
)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
For full control, pass `package_manager` and `python_interpreter_provider` explicitly, or call `resolve_publish_environment()` before `publish()`.
|
|
214
|
+
|
|
215
|
+
## CLI
|
|
216
|
+
|
|
217
|
+
QuickPub installs a `quickpub` command that wraps `publish()` via [Fire](https://github.com/google/python-fire). For most projects, a `publish.py` script is easier to maintain than long CLI invocations.
|
|
218
|
+
|
|
219
|
+
## Development
|
|
220
|
+
|
|
221
|
+
To work on QuickPub itself, clone the repo and use uv:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
git clone https://github.com/danielnachumdev/quickpub.git
|
|
225
|
+
cd quickpub
|
|
226
|
+
uv sync
|
|
227
|
+
uv run pytest
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
MIT — see [LICENSE](LICENSE).
|
quickpub-4.1.2/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# QuickPub
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Catch publish failures on your machine before they hit CI or PyPI.
|
|
7
|
+
|
|
8
|
+
QuickPub runs pre-publish checks, quality tools, tests, packaging, and upload in one pipeline — so broken releases fail locally with fast feedback.
|
|
9
|
+
|
|
10
|
+
## The problem
|
|
11
|
+
|
|
12
|
+
Publishing a Python package usually means juggling several steps: validate project files, run mypy/pylint/pytest, bump the version, generate packaging files, build the sdist, upload to PyPI. Miss a step and you find out in CI — or worse, after a bad release.
|
|
13
|
+
|
|
14
|
+
QuickPub wires those steps together. You define your package once; it enforces constraints, runs QA across Python environments, builds, and uploads.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install quickpub
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
With [uv](https://docs.astral.sh/uv/):
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv add quickpub
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Requires Python **3.8+** (tested on 3.8–3.13).
|
|
29
|
+
|
|
30
|
+
## Quick start
|
|
31
|
+
|
|
32
|
+
Add a `publish.py` in your project root:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from quickpub import (
|
|
36
|
+
publish,
|
|
37
|
+
MypyRunner,
|
|
38
|
+
PylintRunner,
|
|
39
|
+
PytestRunner,
|
|
40
|
+
SetuptoolsBuildSchema,
|
|
41
|
+
PypircUploadTarget,
|
|
42
|
+
PypircEnforcer,
|
|
43
|
+
ReadmeEnforcer,
|
|
44
|
+
LicenseEnforcer,
|
|
45
|
+
LocalVersionEnforcer,
|
|
46
|
+
PypiRemoteVersionEnforcer,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
publish(
|
|
50
|
+
name="my-package",
|
|
51
|
+
version="1.0.0",
|
|
52
|
+
author="Your Name",
|
|
53
|
+
author_email="you@example.com",
|
|
54
|
+
description="My package",
|
|
55
|
+
homepage="https://github.com/you/my-package",
|
|
56
|
+
dependencies=["requests>=2.25.0"],
|
|
57
|
+
min_python="3.8.0",
|
|
58
|
+
enforcers=[
|
|
59
|
+
PypircEnforcer(),
|
|
60
|
+
ReadmeEnforcer(),
|
|
61
|
+
LicenseEnforcer(),
|
|
62
|
+
LocalVersionEnforcer(),
|
|
63
|
+
PypiRemoteVersionEnforcer(),
|
|
64
|
+
],
|
|
65
|
+
global_quality_assurance_runners=[
|
|
66
|
+
MypyRunner(bound="<=20"),
|
|
67
|
+
PylintRunner(bound=">=0.8"),
|
|
68
|
+
PytestRunner(bound=">=0.95"),
|
|
69
|
+
],
|
|
70
|
+
build_schemas=[SetuptoolsBuildSchema()],
|
|
71
|
+
upload_targets=[PypircUploadTarget()],
|
|
72
|
+
)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### uv / `pyproject.toml` projects (important)
|
|
76
|
+
|
|
77
|
+
If the project already has a PEP 621 `pyproject.toml` (uv, Hatch, Poetry, PDM), **do not** use the default file generation. `publish()` would overwrite `pyproject.toml` and wipe `[dependency-groups]`, `[tool.uv]`, `[tool.mypy]`, and other toolchain config.
|
|
78
|
+
|
|
79
|
+
Use `UvBuildSchema` and `generate_project_files=False`:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from quickpub import (
|
|
83
|
+
publish,
|
|
84
|
+
UvBuildSchema,
|
|
85
|
+
PypircUploadTarget,
|
|
86
|
+
PypircEnforcer,
|
|
87
|
+
ReadmeEnforcer,
|
|
88
|
+
LicenseEnforcer,
|
|
89
|
+
LocalVersionEnforcer,
|
|
90
|
+
PypiRemoteVersionEnforcer,
|
|
91
|
+
MypyRunner,
|
|
92
|
+
PylintRunner,
|
|
93
|
+
PytestRunner,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
publish(
|
|
97
|
+
name="my-package",
|
|
98
|
+
version="1.0.0",
|
|
99
|
+
author="Your Name",
|
|
100
|
+
author_email="you@example.com",
|
|
101
|
+
description="My package",
|
|
102
|
+
homepage="https://github.com/you/my-package",
|
|
103
|
+
dependencies=["requests>=2.25.0"],
|
|
104
|
+
min_python="3.8.0",
|
|
105
|
+
enforcers=[
|
|
106
|
+
PypircEnforcer(),
|
|
107
|
+
ReadmeEnforcer(),
|
|
108
|
+
LicenseEnforcer(),
|
|
109
|
+
LocalVersionEnforcer(),
|
|
110
|
+
PypiRemoteVersionEnforcer(),
|
|
111
|
+
],
|
|
112
|
+
global_quality_assurance_runners=[
|
|
113
|
+
MypyRunner(bound="<=20"),
|
|
114
|
+
PylintRunner(bound=">=0.8"),
|
|
115
|
+
PytestRunner(bound=">=0.95"),
|
|
116
|
+
],
|
|
117
|
+
build_schemas=[UvBuildSchema()],
|
|
118
|
+
generate_project_files=False,
|
|
119
|
+
upload_targets=[PypircUploadTarget()],
|
|
120
|
+
)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
That keeps the existing `pyproject.toml`, bumps only `[project].version` and `__init__.__version__`, and builds with `uv build`. See [this repo's `publish.py`](publish.py).
|
|
124
|
+
|
|
125
|
+
Run it:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
python publish.py
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Dry run** — validate and run QA without building or uploading:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
publish(..., demo=True)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
PyPI upload needs a valid `.pypirc`. See [this repo's `publish.py`](publish.py) for a full working example.
|
|
138
|
+
|
|
139
|
+
## What runs
|
|
140
|
+
|
|
141
|
+
When you call `publish()`, QuickPub runs these stages in order:
|
|
142
|
+
|
|
143
|
+
1. **Enforcers** — checks README, LICENSE, `.pypirc`, and local/PyPI version consistency
|
|
144
|
+
2. **Quality assurance** — mypy, pylint, pytest, and unittest with configurable score bounds, in parallel across detected Python environments
|
|
145
|
+
3. **File generation** — by default writes `setup.py`, `pyproject.toml`, `MANIFEST.in`, and updates `__init__.py`. Pass `generate_project_files=False` to keep an existing `pyproject.toml` (only `[project].version` and `__init__.__version__` are updated).
|
|
146
|
+
4. **Build & upload** — builds the sdist (`SetuptoolsBuildSchema` or `UvBuildSchema`) and uploads via twine (and optionally pushes to GitHub)
|
|
147
|
+
|
|
148
|
+
Skip build and upload with `demo=True`.
|
|
149
|
+
|
|
150
|
+
## Environment detection
|
|
151
|
+
|
|
152
|
+
By default, QuickPub detects your toolchain from the project root:
|
|
153
|
+
|
|
154
|
+
| Project layout | Package manager | Python provider |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| `uv.lock` present | `UvPackageManager` | `UvPythonProvider` |
|
|
157
|
+
| otherwise | `PipPackageManager` | `DefaultPythonProvider` |
|
|
158
|
+
|
|
159
|
+
Override for conda or mixed setups:
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from quickpub import CondaPythonProvider, UnionProvider
|
|
163
|
+
|
|
164
|
+
publish(
|
|
165
|
+
...,
|
|
166
|
+
python_interpreter_provider=UnionProvider([
|
|
167
|
+
CondaPythonProvider(["base", "py39", "py38"]),
|
|
168
|
+
]),
|
|
169
|
+
)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
For full control, pass `package_manager` and `python_interpreter_provider` explicitly, or call `resolve_publish_environment()` before `publish()`.
|
|
173
|
+
|
|
174
|
+
## CLI
|
|
175
|
+
|
|
176
|
+
QuickPub installs a `quickpub` command that wraps `publish()` via [Fire](https://github.com/google/python-fire). For most projects, a `publish.py` script is easier to maintain than long CLI invocations.
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
To work on QuickPub itself, clone the repo and use uv:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
git clone https://github.com/danielnachumdev/quickpub.git
|
|
184
|
+
cd quickpub
|
|
185
|
+
uv sync
|
|
186
|
+
uv run pytest
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "quickpub"
|
|
7
|
+
version = "4.1.2"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "danielnachumdev", email = "danielnachumdev@gmail.com" },
|
|
10
|
+
]
|
|
11
|
+
dependencies = [
|
|
12
|
+
"danielutils>=1.1.23",
|
|
13
|
+
"requests",
|
|
14
|
+
"fire",
|
|
15
|
+
"twine",
|
|
16
|
+
]
|
|
17
|
+
keywords = []
|
|
18
|
+
license = { "file" = "./LICENSE" }
|
|
19
|
+
description = "A local CI/CD simulation tool that runs quality checks, tests, and validations locally before publishing Python packages, ensuring higher build pass rates and faster feedback loops"
|
|
20
|
+
readme = {file = "./README.md", content-type = "text/markdown"}
|
|
21
|
+
requires-python = ">=3.8.0"
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Development Status :: 3 - Alpha",
|
|
24
|
+
"Intended Audience :: Developers",
|
|
25
|
+
"Programming Language :: Python :: 3",
|
|
26
|
+
"Operating System :: Microsoft :: Windows"
|
|
27
|
+
]
|
|
28
|
+
[project.scripts]
|
|
29
|
+
quickpub = "quickpub.__main__:main"
|
|
30
|
+
|
|
31
|
+
[tool.setuptools]
|
|
32
|
+
packages = ["quickpub"]
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.package-data]
|
|
35
|
+
"quickpub" = ["py.typed"]
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
"Homepage" = "https://github.com/danielnachumdev/quickpub"
|
|
39
|
+
"Bug Tracker" = "https://github.com/danielnachumdev/quickpub/issues"
|
|
40
|
+
|
|
41
|
+
[dependency-groups]
|
|
42
|
+
dev = [
|
|
43
|
+
"githooklib>=1.0.0",
|
|
44
|
+
"tqdm",
|
|
45
|
+
"pylint",
|
|
46
|
+
"mypy",
|
|
47
|
+
"types-tqdm",
|
|
48
|
+
"types-requests",
|
|
49
|
+
"beautifulsoup4",
|
|
50
|
+
"setuptools",
|
|
51
|
+
"black",
|
|
52
|
+
]
|
|
53
|
+
test = [
|
|
54
|
+
"pytest",
|
|
55
|
+
"pytest-xdist",
|
|
56
|
+
"pytest-asyncio",
|
|
57
|
+
"pytest-cov",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.uv]
|
|
61
|
+
default-groups = ["dev", "test"]
|
|
62
|
+
|
|
63
|
+
[tool.pytest.ini_options]
|
|
64
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
65
|
+
testpaths = ["tests"]
|
|
66
|
+
python_files = ["test_*.py"]
|
|
67
|
+
python_classes = ["Test*"]
|
|
68
|
+
python_functions = ["test_*"]
|
|
69
|
+
addopts = [
|
|
70
|
+
"-q",
|
|
71
|
+
"--strict-markers",
|
|
72
|
+
"--tb=short",
|
|
73
|
+
"--cov",
|
|
74
|
+
"--cov-report=html",
|
|
75
|
+
"--cov-report=term-missing",
|
|
76
|
+
"--color=yes",
|
|
77
|
+
"--durations=10",
|
|
78
|
+
"--maxfail=10",
|
|
79
|
+
]
|
|
80
|
+
markers = [
|
|
81
|
+
"unit: Unit tests",
|
|
82
|
+
"integration: Integration tests",
|
|
83
|
+
"slow: Slow running tests",
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
[tool.coverage.run]
|
|
87
|
+
source = ["quickpub"]
|
|
88
|
+
branch = false
|
|
89
|
+
parallel = false
|
|
90
|
+
|
|
91
|
+
[tool.coverage.report]
|
|
92
|
+
precision = 2
|
|
93
|
+
show_missing = true
|
|
94
|
+
skip_covered = false
|
|
95
|
+
fail_under = 50
|
|
96
|
+
sort = "Cover"
|
|
97
|
+
|
|
98
|
+
[tool.coverage.html]
|
|
99
|
+
directory = "htmlcov"
|
|
100
|
+
|
|
101
|
+
[tool.mypy]
|
|
102
|
+
disallow_untyped_calls = true
|
|
103
|
+
check_untyped_defs = true
|
|
104
|
+
no_implicit_optional = true
|
|
105
|
+
strict_optional = true
|
|
106
|
+
namespace_packages = true
|
|
107
|
+
explicit_package_bases = true
|
|
108
|
+
files = ["quickpub/*.py", "tests", "publish.py"]
|
|
109
|
+
|
|
110
|
+
[[tool.mypy.overrides]]
|
|
111
|
+
module = "*"
|
|
112
|
+
ignore_missing_imports = true
|
|
113
|
+
|
|
114
|
+
[tool.pylint.main]
|
|
115
|
+
ignore-paths = ["^tests/.*", "^tmp/.*"]
|
|
116
|
+
|
|
117
|
+
[tool.pylint.basic]
|
|
118
|
+
good-names = ["foo", "bar"]
|
|
119
|
+
good-names-rgxs = ["^[a-zA-Z]"]
|
|
120
|
+
|
|
121
|
+
[tool.pylint.naming]
|
|
122
|
+
class-rgx = "^(_)?[A-Z][a-zA-Z0-9]*$"
|
|
123
|
+
module-rgx = "^[a-zA-Z][a-zA-Z0-9_]*$"
|
|
124
|
+
|
|
125
|
+
[tool.pylint.messages_control]
|
|
126
|
+
disable = [
|
|
127
|
+
"W0211",
|
|
128
|
+
"C0114",
|
|
129
|
+
"E1120",
|
|
130
|
+
"E0611",
|
|
131
|
+
"W0702",
|
|
132
|
+
"W0612",
|
|
133
|
+
"R0913",
|
|
134
|
+
"C0415",
|
|
135
|
+
"R0912",
|
|
136
|
+
"R0903",
|
|
137
|
+
"R0914",
|
|
138
|
+
"R0911",
|
|
139
|
+
"R1716",
|
|
140
|
+
"W0401",
|
|
141
|
+
"R0801",
|
|
142
|
+
"C0116",
|
|
143
|
+
"W0212",
|
|
144
|
+
"C0115",
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
[tool.pylint.format]
|
|
148
|
+
max-line-length = 120
|
|
@@ -25,7 +25,13 @@ from .validators import (
|
|
|
25
25
|
validate_source,
|
|
26
26
|
)
|
|
27
27
|
from .structures import Version, Dependency
|
|
28
|
-
from .files import
|
|
28
|
+
from .files import (
|
|
29
|
+
create_toml,
|
|
30
|
+
create_setup,
|
|
31
|
+
create_manifest,
|
|
32
|
+
add_version_to_init,
|
|
33
|
+
update_pyproject_version,
|
|
34
|
+
)
|
|
29
35
|
from .classifiers import *
|
|
30
36
|
from .qa import qa, SupportsProgress
|
|
31
37
|
from .logging_ import setup_logging
|
|
@@ -155,6 +161,15 @@ def _create_package_files(
|
|
|
155
161
|
add_version_to_init(src_folder_path=explicit_src_folder_path, version=version)
|
|
156
162
|
|
|
157
163
|
|
|
164
|
+
def _sync_existing_package_metadata(
|
|
165
|
+
explicit_src_folder_path: str,
|
|
166
|
+
version: Version,
|
|
167
|
+
pyproject_path: str = "./pyproject.toml",
|
|
168
|
+
) -> None:
|
|
169
|
+
update_pyproject_version(version=version, pyproject_path=pyproject_path)
|
|
170
|
+
add_version_to_init(src_folder_path=explicit_src_folder_path, version=version)
|
|
171
|
+
|
|
172
|
+
|
|
158
173
|
def _build_and_upload_packages(
|
|
159
174
|
build_schemas: List[BuildSchema],
|
|
160
175
|
upload_targets: List[UploadTarget],
|
|
@@ -193,6 +208,7 @@ def publish(
|
|
|
193
208
|
scripts: Optional[Dict[str, Callable]] = None,
|
|
194
209
|
pbar: Optional[SupportsProgress] = None,
|
|
195
210
|
demo: bool = False,
|
|
211
|
+
generate_project_files: bool = True,
|
|
196
212
|
config: Optional[Any] = None,
|
|
197
213
|
) -> None:
|
|
198
214
|
start_time = time.perf_counter()
|
|
@@ -222,21 +238,27 @@ def publish(
|
|
|
222
238
|
pbar,
|
|
223
239
|
package_manager,
|
|
224
240
|
)
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
241
|
+
if generate_project_files:
|
|
242
|
+
_create_package_files(
|
|
243
|
+
name,
|
|
244
|
+
validated_src_path,
|
|
245
|
+
readme_file_path,
|
|
246
|
+
license_file_path,
|
|
247
|
+
validated_version,
|
|
248
|
+
author,
|
|
249
|
+
author_email,
|
|
250
|
+
description,
|
|
251
|
+
homepage,
|
|
252
|
+
validated_keywords,
|
|
253
|
+
validated_deps,
|
|
254
|
+
validated_min_python,
|
|
255
|
+
scripts,
|
|
256
|
+
)
|
|
257
|
+
else:
|
|
258
|
+
_sync_existing_package_metadata(
|
|
259
|
+
validated_src_path,
|
|
260
|
+
validated_version,
|
|
261
|
+
)
|
|
240
262
|
_build_and_upload_packages(
|
|
241
263
|
build_schemas, upload_targets, name, validated_version, demo
|
|
242
264
|
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import List, Union
|
|
4
|
+
|
|
5
|
+
from .enforcers import ExitEarlyError
|
|
6
|
+
from .structures import Version
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def normalize_dist_name(name: str) -> str:
|
|
10
|
+
return re.sub(r"[-_.]+", "-", name).lower()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def find_sdist(
|
|
14
|
+
dist_dir: Union[str, Path],
|
|
15
|
+
name: str,
|
|
16
|
+
version: Union[str, Version],
|
|
17
|
+
) -> Path:
|
|
18
|
+
dist_path = Path(dist_dir)
|
|
19
|
+
version_str = str(version)
|
|
20
|
+
candidates: List[Path] = []
|
|
21
|
+
for candidate_name in (name, normalize_dist_name(name)):
|
|
22
|
+
candidate = dist_path / f"{candidate_name}-{version_str}.tar.gz"
|
|
23
|
+
if candidate not in candidates:
|
|
24
|
+
candidates.append(candidate)
|
|
25
|
+
for candidate in candidates:
|
|
26
|
+
if candidate.exists():
|
|
27
|
+
return candidate
|
|
28
|
+
raise ExitEarlyError(
|
|
29
|
+
f"Could not find sdist for '{name}' version '{version_str}' in '{dist_path}'"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
__all__ = ["normalize_dist_name", "find_sdist"]
|