test-python-package-release 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl
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.
- test_python_package_release/__init__.py +1 -1
- test_python_package_release-0.3.2.dist-info/METADATA +189 -0
- test_python_package_release-0.3.2.dist-info/RECORD +7 -0
- test_python_package_release-0.3.0.dist-info/METADATA +0 -124
- test_python_package_release-0.3.0.dist-info/RECORD +0 -7
- {test_python_package_release-0.3.0.dist-info → test_python_package_release-0.3.2.dist-info}/WHEEL +0 -0
- {test_python_package_release-0.3.0.dist-info → test_python_package_release-0.3.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Test Python package release — template library."""
|
|
2
2
|
|
|
3
|
-
__version__ = "0.3.
|
|
3
|
+
__version__ = "0.3.2" # managed by release-please
|
|
4
4
|
|
|
5
5
|
from test_python_package_release.calculator import add, divide, multiply, power, subtract
|
|
6
6
|
from test_python_package_release.strings import reverse_string, snake_to_camel
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: test-python-package-release
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Template library demonstrating Python package release CI/CD
|
|
5
|
+
Author-email: Dawid Wozniak <wozniakos10@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Dawid Wozniak
|
|
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
|
+
License-File: LICENSE
|
|
28
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
29
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
30
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
32
|
+
Requires-Python: >=3.11
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# test-python-package-release
|
|
36
|
+
|
|
37
|
+
Template repository demonstrating a complete CI/CD pipeline for Python packages
|
|
38
|
+
published to PyPI.
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
uv sync --group dev
|
|
44
|
+
uv run pytest
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Project layout
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
.
|
|
51
|
+
├── .github/workflows/ # CI, Claude review, release-please, publish
|
|
52
|
+
├── src/ # library code (src/ layout)
|
|
53
|
+
├── tests/ # pytest tests
|
|
54
|
+
├── pyproject.toml # single source of truth: build, deps, ruff, pytest, tox
|
|
55
|
+
├── .pre-commit-config.yaml
|
|
56
|
+
├── commitlint.config.cjs
|
|
57
|
+
└── CHANGELOG.md # managed by release-please
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Development tooling
|
|
61
|
+
|
|
62
|
+
The template ships with an opinionated, modern Python toolchain — all
|
|
63
|
+
configured in `pyproject.toml` (no scattered config files).
|
|
64
|
+
|
|
65
|
+
| Tool | Purpose | Where it runs |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| [**uv**](https://docs.astral.sh/uv/) | Package manager, virtualenv handler, Python installer, build tool. Replaces `pip` + `venv` + `pip-tools` + `pyenv`. | Local + CI |
|
|
68
|
+
| [**ruff**](https://docs.astral.sh/ruff/) | Linter + formatter (replaces flake8, isort, black, pyupgrade). | pre-commit + CI lint job |
|
|
69
|
+
| [**ty**](https://github.com/astral-sh/ty) | Static type checker by Astral (faster mypy alternative). | CI lint job + `tox -e type` |
|
|
70
|
+
| [**pytest**](https://docs.pytest.org/) | Test runner. | Local + CI test matrix |
|
|
71
|
+
| [**pytest-cov**](https://pytest-cov.readthedocs.io/) | Coverage reporting via `coverage.py`. | On-demand (`pytest --cov`) |
|
|
72
|
+
| [**tox**](https://tox.wiki/) + [**tox-uv**](https://github.com/tox-dev/tox-uv) | Isolated test environments per Python version (3.11, 3.12, 3.13) backed by uv for speed. | Local + CI test matrix |
|
|
73
|
+
| [**pre-commit**](https://pre-commit.com/) | Git hook framework — runs ruff and conventional-commit checks before every commit. | Local |
|
|
74
|
+
| [**conventional-pre-commit**](https://github.com/compilerla/conventional-pre-commit) | Pure-Python validator for [Conventional Commits](https://www.conventionalcommits.org/) commit messages. | pre-commit (commit-msg stage) |
|
|
75
|
+
| [**commitlint**](https://commitlint.js.org/) | Node-based validator that re-checks every commit on a PR. | CI `commitlint` job |
|
|
76
|
+
| [**hatchling**](https://hatch.pypa.io/) | PEP 517 build backend used by `uv build` to produce wheel/sdist. | Build / publish |
|
|
77
|
+
| [**release-please**](https://github.com/googleapis/release-please) | Parses Conventional Commits → bumps version → updates CHANGELOG → tags releases. | CI on push to `main` |
|
|
78
|
+
| [**claude-code-action**](https://github.com/anthropics/claude-code-action) | Claude reviews PRs on demand when you comment `@claude`. | CI on PR comment |
|
|
79
|
+
| [**Dependabot**](https://docs.github.com/en/code-security/dependabot) | Weekly grouped PRs updating GitHub Actions and uv dev-dependencies. | GitHub native |
|
|
80
|
+
|
|
81
|
+
## Development commands
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Install all dev deps + create .venv
|
|
85
|
+
uv sync --group dev
|
|
86
|
+
|
|
87
|
+
# Install hooks (runs ruff and conventional commit-msg validation)
|
|
88
|
+
uv run pre-commit install --hook-type pre-commit --hook-type commit-msg
|
|
89
|
+
|
|
90
|
+
# Full test matrix (3.11, 3.12, 3.13) — tox spawns isolated uv envs per version
|
|
91
|
+
uv run tox
|
|
92
|
+
|
|
93
|
+
# Single env (fastest iteration)
|
|
94
|
+
uv run tox -e py313 -- -k calculator # only tests matching "calculator"
|
|
95
|
+
|
|
96
|
+
# Lint / format / type check (one-off, without tox)
|
|
97
|
+
uv run ruff check .
|
|
98
|
+
uv run ruff format --check .
|
|
99
|
+
uv run ty check src
|
|
100
|
+
|
|
101
|
+
# Build the distribution locally
|
|
102
|
+
uv build
|
|
103
|
+
|
|
104
|
+
# Add a new dependency (auto-updates uv.lock — commit both files)
|
|
105
|
+
uv add httpx
|
|
106
|
+
uv add --group dev pytest-mock
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Commits
|
|
110
|
+
|
|
111
|
+
Every commit MUST follow the
|
|
112
|
+
[Conventional Commits](https://www.conventionalcommits.org/) specification.
|
|
113
|
+
|
|
114
|
+
Examples:
|
|
115
|
+
- `feat: add support for negative numbers`
|
|
116
|
+
- `fix(calculator): correct divide by zero error`
|
|
117
|
+
- `chore(deps): bump ruff to 0.9`
|
|
118
|
+
- `feat!: drop Python 3.10 support` (breaking change → major bump)
|
|
119
|
+
|
|
120
|
+
Enforced locally by `conventional-pre-commit` (commit-msg hook) and in CI by
|
|
121
|
+
`commitlint`.
|
|
122
|
+
|
|
123
|
+
## Release flow
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
PR opened ──▶ ci.yml (lint, ty, pytest matrix, commitlint)
|
|
127
|
+
│
|
|
128
|
+
└─ optional: comment "@claude" ──▶ claude-review.yml
|
|
129
|
+
|
|
130
|
+
PR merged ──▶ main ──▶ release-please.yml
|
|
131
|
+
│
|
|
132
|
+
└─ creates/updates a "Release PR"
|
|
133
|
+
(bumps version, regenerates CHANGELOG)
|
|
134
|
+
|
|
135
|
+
Release PR merged ──▶ release-please tags + creates GitHub Release
|
|
136
|
+
│
|
|
137
|
+
└─ publish.yml ──▶ uv build
|
|
138
|
+
──▶ TestPyPI (OIDC)
|
|
139
|
+
──▶ PyPI (OIDC, gated env)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## First-time setup after cloning the template
|
|
143
|
+
|
|
144
|
+
1. **Rename the package**: update `name` in `pyproject.toml`, the directory
|
|
145
|
+
under `src/`, and imports in `tests/`. Also update the `package-name` and
|
|
146
|
+
`extra-files` paths in `.github/release-please-config.json`.
|
|
147
|
+
|
|
148
|
+
2. **Workflow permissions**: Settings → Actions → General → Workflow
|
|
149
|
+
permissions. Enable:
|
|
150
|
+
- "Read and write permissions"
|
|
151
|
+
- "Allow GitHub Actions to create and approve pull requests"
|
|
152
|
+
|
|
153
|
+
3. **Personal Access Token for release-please**: create a fine-grained PAT
|
|
154
|
+
([generate here](https://github.com/settings/personal-access-tokens/new))
|
|
155
|
+
scoped to this repo with `Contents: read+write`, `Pull requests: read+write`,
|
|
156
|
+
`Workflows: read+write`. Add as repository secret `RELEASE_PLEASE_TOKEN`.
|
|
157
|
+
(Required so the GitHub Release created by release-please triggers the
|
|
158
|
+
`publish.yml` workflow — events from the default `GITHUB_TOKEN` do not
|
|
159
|
+
trigger other workflows.)
|
|
160
|
+
|
|
161
|
+
4. **Install the Claude Code GitHub App** at
|
|
162
|
+
[github.com/apps/claude](https://github.com/apps/claude) and grant access to
|
|
163
|
+
this repo. Add `ANTHROPIC_API_KEY` repository secret.
|
|
164
|
+
|
|
165
|
+
5. **Configure Trusted Publishers** on
|
|
166
|
+
[PyPI](https://docs.pypi.org/trusted-publishers/) and
|
|
167
|
+
[TestPyPI](https://docs.pypi.org/trusted-publishers/) for your repo. Use
|
|
168
|
+
"pending publisher" if the project doesn't exist yet. Point each to:
|
|
169
|
+
- Workflow name: `publish.yml`
|
|
170
|
+
- Environment name: `pypi` (production) and `testpypi` respectively
|
|
171
|
+
|
|
172
|
+
6. **Create GitHub Environments** `testpypi` and `pypi` under Settings →
|
|
173
|
+
Environments. For each, under **Deployment branches and tags**:
|
|
174
|
+
- Select "Selected branches and tags"
|
|
175
|
+
- Add a **branch** rule: `main`
|
|
176
|
+
- Add a **tag** rule (toggle ref type to "Tag" in the modal): use the tag
|
|
177
|
+
pattern that release-please produces — by default
|
|
178
|
+
`<package-name>-v*` (e.g. `test-python-package-release-v*`)
|
|
179
|
+
|
|
180
|
+
7. **(Optional) Branch protection ruleset** for `main`:
|
|
181
|
+
- Require a PR before merging
|
|
182
|
+
- Require status checks: `lint`, `test (3.11)`, `test (3.12)`,
|
|
183
|
+
`test (3.13)`, `commitlint`
|
|
184
|
+
- Block force pushes, restrict deletions
|
|
185
|
+
- Add yourself to the bypass list so you can merge release-please PRs
|
|
186
|
+
|
|
187
|
+
8. **(Optional) Production gate** for PyPI publishing — on Pro/Team/Enterprise
|
|
188
|
+
plans only: add a Required reviewer on the `pypi` environment to require
|
|
189
|
+
manual approval before production publish.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
test_python_package_release/__init__.py,sha256=S4is54cjE3dNkHqDIlVVXFJMu1DUH-UjkZAedmRtO60,407
|
|
2
|
+
test_python_package_release/calculator.py,sha256=sYwW1XekGBp1ZCkEqQ4mD9Y1TF1pm6uMW0L8VASVIW8,389
|
|
3
|
+
test_python_package_release/strings.py,sha256=wfMdEde8gKrxVJ-HJMsYbgV8IjahgqIRPy5JjLpN1wY,176
|
|
4
|
+
test_python_package_release-0.3.2.dist-info/METADATA,sha256=XN9i6z2Ngmge1RjhQJ6AeN3Ck8Ycy15suBK0w7LMFDo,8797
|
|
5
|
+
test_python_package_release-0.3.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
6
|
+
test_python_package_release-0.3.2.dist-info/licenses/LICENSE,sha256=FK3qjfsYq7ZWgF5WWecz0lQFe6PoBbKyNYK2hBs0aN8,1070
|
|
7
|
+
test_python_package_release-0.3.2.dist-info/RECORD,,
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: test-python-package-release
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: Template library demonstrating Python package release CI/CD
|
|
5
|
-
Author-email: Dawid Wozniak <wozniakos10@gmail.com>
|
|
6
|
-
License: MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2026 Dawid Wozniak
|
|
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
|
-
License-File: LICENSE
|
|
28
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
29
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
30
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
31
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
32
|
-
Requires-Python: >=3.11
|
|
33
|
-
Description-Content-Type: text/markdown
|
|
34
|
-
|
|
35
|
-
# test-python-package-release
|
|
36
|
-
|
|
37
|
-
Template repository demonstrating a complete CI/CD pipeline for Python packages
|
|
38
|
-
published to PyPI.
|
|
39
|
-
|
|
40
|
-
## Quick start
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
uv sync --group dev
|
|
44
|
-
uv run pytest
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Project layout
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
.
|
|
51
|
-
├── .github/workflows/ # CI, Claude review, release-please, publish
|
|
52
|
-
├── src/ # library code (src/ layout)
|
|
53
|
-
├── tests/ # pytest tests
|
|
54
|
-
├── pyproject.toml # single source of truth: build, deps, ruff, pytest, tox
|
|
55
|
-
├── .pre-commit-config.yaml
|
|
56
|
-
├── commitlint.config.js
|
|
57
|
-
└── CHANGELOG.md # managed by release-please
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Development
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# Install hooks (runs ruff + ty pre-commit, conventional commit-msg)
|
|
64
|
-
uv run pre-commit install --hook-type pre-commit --hook-type commit-msg
|
|
65
|
-
|
|
66
|
-
# Run the full test matrix (3.11, 3.12, 3.13)
|
|
67
|
-
uv run tox
|
|
68
|
-
|
|
69
|
-
# Single env
|
|
70
|
-
uv run tox -e py313 -- -k calculator
|
|
71
|
-
|
|
72
|
-
# Lint / format check / type check
|
|
73
|
-
uv run ruff check .
|
|
74
|
-
uv run ruff format --check .
|
|
75
|
-
uv run ty check src
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Commits
|
|
79
|
-
|
|
80
|
-
Every commit MUST follow the
|
|
81
|
-
[Conventional Commits](https://www.conventionalcommits.org/) specification.
|
|
82
|
-
|
|
83
|
-
Examples:
|
|
84
|
-
- `feat: add support for negative numbers`
|
|
85
|
-
- `fix(calculator): correct divide by zero error`
|
|
86
|
-
- `chore(deps): bump ruff to 0.9`
|
|
87
|
-
- `feat!: drop Python 3.10 support` (breaking change → major bump)
|
|
88
|
-
|
|
89
|
-
Enforced locally by `conventional-pre-commit` (commit-msg hook) and in CI by
|
|
90
|
-
`commitlint`.
|
|
91
|
-
|
|
92
|
-
## Release flow
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
PR opened ──▶ ci.yml (lint, ty, pytest matrix, commitlint)
|
|
96
|
-
│
|
|
97
|
-
└─ optional: comment "@claude" ──▶ claude-review.yml
|
|
98
|
-
|
|
99
|
-
PR merged ──▶ main ──▶ release-please.yml
|
|
100
|
-
│
|
|
101
|
-
└─ creates/updates a "Release PR"
|
|
102
|
-
(bumps version, regenerates CHANGELOG)
|
|
103
|
-
|
|
104
|
-
Release PR merged ──▶ release-please tags + creates GitHub Release
|
|
105
|
-
│
|
|
106
|
-
└─ publish.yml ──▶ uv build
|
|
107
|
-
──▶ TestPyPI (OIDC)
|
|
108
|
-
──▶ PyPI (OIDC, gated env)
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## First-time setup after cloning the template
|
|
112
|
-
|
|
113
|
-
1. Rename `name` in `pyproject.toml`, the package directory under `src/`, and
|
|
114
|
-
imports in `tests/`.
|
|
115
|
-
2. Configure Trusted Publishers on
|
|
116
|
-
[PyPI](https://docs.pypi.org/trusted-publishers/) and
|
|
117
|
-
[TestPyPI](https://docs.pypi.org/trusted-publishers/) for your repo, pointing
|
|
118
|
-
to the `publish.yml` workflow and the `pypi` / `testpypi` environments.
|
|
119
|
-
3. Create two GitHub Environments named `testpypi` and `pypi` (optionally add
|
|
120
|
-
required reviewers on `pypi` as a manual prod gate).
|
|
121
|
-
4. Add an `ANTHROPIC_API_KEY` repository secret (for the Claude review
|
|
122
|
-
workflow).
|
|
123
|
-
5. Settings → Actions → General → Workflow permissions → "Read and write
|
|
124
|
-
permissions" so release-please can open PRs and push tags.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
test_python_package_release/__init__.py,sha256=YKoPSJA9095KuH1qsUh6R8ZX4MNyOV9gk81-mLfz4BE,407
|
|
2
|
-
test_python_package_release/calculator.py,sha256=sYwW1XekGBp1ZCkEqQ4mD9Y1TF1pm6uMW0L8VASVIW8,389
|
|
3
|
-
test_python_package_release/strings.py,sha256=wfMdEde8gKrxVJ-HJMsYbgV8IjahgqIRPy5JjLpN1wY,176
|
|
4
|
-
test_python_package_release-0.3.0.dist-info/METADATA,sha256=i5mUi66j-yPbLmqxdtCVfo-QpIIOU14-z_cKnqSb1m0,4623
|
|
5
|
-
test_python_package_release-0.3.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
6
|
-
test_python_package_release-0.3.0.dist-info/licenses/LICENSE,sha256=FK3qjfsYq7ZWgF5WWecz0lQFe6PoBbKyNYK2hBs0aN8,1070
|
|
7
|
-
test_python_package_release-0.3.0.dist-info/RECORD,,
|
{test_python_package_release-0.3.0.dist-info → test_python_package_release-0.3.2.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|