test-python-package-release 0.3.0__tar.gz → 0.3.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.
Files changed (29) hide show
  1. test_python_package_release-0.3.2/.github/.release-please-manifest.json +3 -0
  2. test_python_package_release-0.3.2/.github/workflows/release-please.yml +44 -0
  3. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/CHANGELOG.md +21 -0
  4. test_python_package_release-0.3.2/PKG-INFO +189 -0
  5. test_python_package_release-0.3.2/README.md +155 -0
  6. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/pyproject.toml +1 -1
  7. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/src/test_python_package_release/__init__.py +1 -1
  8. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/uv.lock +1 -1
  9. test_python_package_release-0.3.0/.github/.release-please-manifest.json +0 -3
  10. test_python_package_release-0.3.0/.github/workflows/release-please.yml +0 -19
  11. test_python_package_release-0.3.0/PKG-INFO +0 -124
  12. test_python_package_release-0.3.0/README.md +0 -90
  13. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.github/dependabot.yml +0 -0
  14. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.github/release-please-config.json +0 -0
  15. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.github/workflows/ci.yml +0 -0
  16. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.github/workflows/claude-review.yml +0 -0
  17. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.github/workflows/publish.yml +0 -0
  18. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.gitignore +0 -0
  19. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.pre-commit-config.yaml +0 -0
  20. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/.python-version +0 -0
  21. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/LICENSE +0 -0
  22. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/commitlint.config.cjs +0 -0
  23. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/docs/superpowers/plans/2026-05-30-python-package-release-template.md +0 -0
  24. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/docs/superpowers/specs/2026-05-30-python-package-release-template-design.md +0 -0
  25. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/src/test_python_package_release/calculator.py +0 -0
  26. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/src/test_python_package_release/strings.py +0 -0
  27. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/tests/__init__.py +0 -0
  28. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/tests/test_calculator.py +0 -0
  29. {test_python_package_release-0.3.0 → test_python_package_release-0.3.2}/tests/test_strings.py +0 -0
@@ -0,0 +1,44 @@
1
+ name: Release Please
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+ pull-requests: write
10
+
11
+ jobs:
12
+ release-please:
13
+ runs-on: ubuntu-latest
14
+ outputs:
15
+ pr: ${{ steps.release.outputs.pr }}
16
+ release_created: ${{ steps.release.outputs.release_created }}
17
+ steps:
18
+ - uses: googleapis/release-please-action@v4
19
+ id: release
20
+ with:
21
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
22
+ config-file: .github/release-please-config.json
23
+ manifest-file: .github/.release-please-manifest.json
24
+
25
+ sync-lockfile:
26
+ needs: release-please
27
+ if: ${{ needs.release-please.outputs.pr }}
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ with:
32
+ ref: ${{ fromJSON(needs.release-please.outputs.pr).headBranchName }}
33
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
34
+ - uses: astral-sh/setup-uv@v4
35
+ - run: uv lock
36
+ - name: Commit and push if lockfile changed
37
+ run: |
38
+ if [[ -n "$(git status --porcelain uv.lock)" ]]; then
39
+ git config user.name "github-actions[bot]"
40
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
41
+ git add uv.lock
42
+ git commit -m "chore: sync uv.lock with bumped version"
43
+ git push
44
+ fi
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.2](https://github.com/wozniakos10/test_python_package_release/compare/test-python-package-release-v0.3.1...test-python-package-release-v0.3.2) (2026-05-30)
4
+
5
+
6
+ ### Documentation
7
+
8
+ * add development tooling table to README ([41a3e31](https://github.com/wozniakos10/test_python_package_release/commit/41a3e31ba0dfcec3da01b1bb1d5d9c5ad06c4f74))
9
+ * add development tooling table to README ([d112e33](https://github.com/wozniakos10/test_python_package_release/commit/d112e333ef4b51e03c5b5cfdcf8725c21a2e1345))
10
+
11
+ ## [0.3.1](https://github.com/wozniakos10/test_python_package_release/compare/test-python-package-release-v0.3.0...test-python-package-release-v0.3.1) (2026-05-30)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **ci:** auto-sync uv.lock + improve setup docs ([a899a19](https://github.com/wozniakos10/test_python_package_release/commit/a899a1968b91039b189885c840c072a5eb7ac7ff))
17
+ * **ci:** auto-sync uv.lock in release PR ([3ad6c92](https://github.com/wozniakos10/test_python_package_release/commit/3ad6c9268eab5ff5a6bbbbb7694cae9cdbf1898b))
18
+
19
+
20
+ ### Documentation
21
+
22
+ * clarify first-time template setup steps ([9ffe772](https://github.com/wozniakos10/test_python_package_release/commit/9ffe7729e9987a09285ae01caf534bbbefa53bd4))
23
+
3
24
  ## [0.3.0](https://github.com/wozniakos10/test_python_package_release/compare/test-python-package-release-v0.2.0...test-python-package-release-v0.3.0) (2026-05-30)
4
25
 
5
26
 
@@ -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,155 @@
1
+ # test-python-package-release
2
+
3
+ Template repository demonstrating a complete CI/CD pipeline for Python packages
4
+ published to PyPI.
5
+
6
+ ## Quick start
7
+
8
+ ```bash
9
+ uv sync --group dev
10
+ uv run pytest
11
+ ```
12
+
13
+ ## Project layout
14
+
15
+ ```
16
+ .
17
+ ├── .github/workflows/ # CI, Claude review, release-please, publish
18
+ ├── src/ # library code (src/ layout)
19
+ ├── tests/ # pytest tests
20
+ ├── pyproject.toml # single source of truth: build, deps, ruff, pytest, tox
21
+ ├── .pre-commit-config.yaml
22
+ ├── commitlint.config.cjs
23
+ └── CHANGELOG.md # managed by release-please
24
+ ```
25
+
26
+ ## Development tooling
27
+
28
+ The template ships with an opinionated, modern Python toolchain — all
29
+ configured in `pyproject.toml` (no scattered config files).
30
+
31
+ | Tool | Purpose | Where it runs |
32
+ |---|---|---|
33
+ | [**uv**](https://docs.astral.sh/uv/) | Package manager, virtualenv handler, Python installer, build tool. Replaces `pip` + `venv` + `pip-tools` + `pyenv`. | Local + CI |
34
+ | [**ruff**](https://docs.astral.sh/ruff/) | Linter + formatter (replaces flake8, isort, black, pyupgrade). | pre-commit + CI lint job |
35
+ | [**ty**](https://github.com/astral-sh/ty) | Static type checker by Astral (faster mypy alternative). | CI lint job + `tox -e type` |
36
+ | [**pytest**](https://docs.pytest.org/) | Test runner. | Local + CI test matrix |
37
+ | [**pytest-cov**](https://pytest-cov.readthedocs.io/) | Coverage reporting via `coverage.py`. | On-demand (`pytest --cov`) |
38
+ | [**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 |
39
+ | [**pre-commit**](https://pre-commit.com/) | Git hook framework — runs ruff and conventional-commit checks before every commit. | Local |
40
+ | [**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) |
41
+ | [**commitlint**](https://commitlint.js.org/) | Node-based validator that re-checks every commit on a PR. | CI `commitlint` job |
42
+ | [**hatchling**](https://hatch.pypa.io/) | PEP 517 build backend used by `uv build` to produce wheel/sdist. | Build / publish |
43
+ | [**release-please**](https://github.com/googleapis/release-please) | Parses Conventional Commits → bumps version → updates CHANGELOG → tags releases. | CI on push to `main` |
44
+ | [**claude-code-action**](https://github.com/anthropics/claude-code-action) | Claude reviews PRs on demand when you comment `@claude`. | CI on PR comment |
45
+ | [**Dependabot**](https://docs.github.com/en/code-security/dependabot) | Weekly grouped PRs updating GitHub Actions and uv dev-dependencies. | GitHub native |
46
+
47
+ ## Development commands
48
+
49
+ ```bash
50
+ # Install all dev deps + create .venv
51
+ uv sync --group dev
52
+
53
+ # Install hooks (runs ruff and conventional commit-msg validation)
54
+ uv run pre-commit install --hook-type pre-commit --hook-type commit-msg
55
+
56
+ # Full test matrix (3.11, 3.12, 3.13) — tox spawns isolated uv envs per version
57
+ uv run tox
58
+
59
+ # Single env (fastest iteration)
60
+ uv run tox -e py313 -- -k calculator # only tests matching "calculator"
61
+
62
+ # Lint / format / type check (one-off, without tox)
63
+ uv run ruff check .
64
+ uv run ruff format --check .
65
+ uv run ty check src
66
+
67
+ # Build the distribution locally
68
+ uv build
69
+
70
+ # Add a new dependency (auto-updates uv.lock — commit both files)
71
+ uv add httpx
72
+ uv add --group dev pytest-mock
73
+ ```
74
+
75
+ ## Commits
76
+
77
+ Every commit MUST follow the
78
+ [Conventional Commits](https://www.conventionalcommits.org/) specification.
79
+
80
+ Examples:
81
+ - `feat: add support for negative numbers`
82
+ - `fix(calculator): correct divide by zero error`
83
+ - `chore(deps): bump ruff to 0.9`
84
+ - `feat!: drop Python 3.10 support` (breaking change → major bump)
85
+
86
+ Enforced locally by `conventional-pre-commit` (commit-msg hook) and in CI by
87
+ `commitlint`.
88
+
89
+ ## Release flow
90
+
91
+ ```
92
+ PR opened ──▶ ci.yml (lint, ty, pytest matrix, commitlint)
93
+ │
94
+ └─ optional: comment "@claude" ──▶ claude-review.yml
95
+
96
+ PR merged ──▶ main ──▶ release-please.yml
97
+ │
98
+ └─ creates/updates a "Release PR"
99
+ (bumps version, regenerates CHANGELOG)
100
+
101
+ Release PR merged ──▶ release-please tags + creates GitHub Release
102
+ │
103
+ └─ publish.yml ──▶ uv build
104
+ ──▶ TestPyPI (OIDC)
105
+ ──▶ PyPI (OIDC, gated env)
106
+ ```
107
+
108
+ ## First-time setup after cloning the template
109
+
110
+ 1. **Rename the package**: update `name` in `pyproject.toml`, the directory
111
+ under `src/`, and imports in `tests/`. Also update the `package-name` and
112
+ `extra-files` paths in `.github/release-please-config.json`.
113
+
114
+ 2. **Workflow permissions**: Settings → Actions → General → Workflow
115
+ permissions. Enable:
116
+ - "Read and write permissions"
117
+ - "Allow GitHub Actions to create and approve pull requests"
118
+
119
+ 3. **Personal Access Token for release-please**: create a fine-grained PAT
120
+ ([generate here](https://github.com/settings/personal-access-tokens/new))
121
+ scoped to this repo with `Contents: read+write`, `Pull requests: read+write`,
122
+ `Workflows: read+write`. Add as repository secret `RELEASE_PLEASE_TOKEN`.
123
+ (Required so the GitHub Release created by release-please triggers the
124
+ `publish.yml` workflow — events from the default `GITHUB_TOKEN` do not
125
+ trigger other workflows.)
126
+
127
+ 4. **Install the Claude Code GitHub App** at
128
+ [github.com/apps/claude](https://github.com/apps/claude) and grant access to
129
+ this repo. Add `ANTHROPIC_API_KEY` repository secret.
130
+
131
+ 5. **Configure Trusted Publishers** on
132
+ [PyPI](https://docs.pypi.org/trusted-publishers/) and
133
+ [TestPyPI](https://docs.pypi.org/trusted-publishers/) for your repo. Use
134
+ "pending publisher" if the project doesn't exist yet. Point each to:
135
+ - Workflow name: `publish.yml`
136
+ - Environment name: `pypi` (production) and `testpypi` respectively
137
+
138
+ 6. **Create GitHub Environments** `testpypi` and `pypi` under Settings →
139
+ Environments. For each, under **Deployment branches and tags**:
140
+ - Select "Selected branches and tags"
141
+ - Add a **branch** rule: `main`
142
+ - Add a **tag** rule (toggle ref type to "Tag" in the modal): use the tag
143
+ pattern that release-please produces — by default
144
+ `<package-name>-v*` (e.g. `test-python-package-release-v*`)
145
+
146
+ 7. **(Optional) Branch protection ruleset** for `main`:
147
+ - Require a PR before merging
148
+ - Require status checks: `lint`, `test (3.11)`, `test (3.12)`,
149
+ `test (3.13)`, `commitlint`
150
+ - Block force pushes, restrict deletions
151
+ - Add yourself to the bypass list so you can merge release-please PRs
152
+
153
+ 8. **(Optional) Production gate** for PyPI publishing — on Pro/Team/Enterprise
154
+ plans only: add a Required reviewer on the `pypi` environment to require
155
+ manual approval before production publish.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "test-python-package-release"
3
- version = "0.3.0"
3
+ version = "0.3.2"
4
4
  description = "Template library demonstrating Python package release CI/CD"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,6 +1,6 @@
1
1
  """Test Python package release — template library."""
2
2
 
3
- __version__ = "0.3.0" # managed by release-please
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
@@ -367,7 +367,7 @@ wheels = [
367
367
 
368
368
  [[package]]
369
369
  name = "test-python-package-release"
370
- version = "0.2.0"
370
+ version = "0.3.2"
371
371
  source = { editable = "." }
372
372
 
373
373
  [package.dev-dependencies]
@@ -1,19 +0,0 @@
1
- name: Release Please
2
-
3
- on:
4
- push:
5
- branches: [main]
6
-
7
- permissions:
8
- contents: write
9
- pull-requests: write
10
-
11
- jobs:
12
- release-please:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: googleapis/release-please-action@v4
16
- with:
17
- token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
18
- config-file: .github/release-please-config.json
19
- manifest-file: .github/.release-please-manifest.json
@@ -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,90 +0,0 @@
1
- # test-python-package-release
2
-
3
- Template repository demonstrating a complete CI/CD pipeline for Python packages
4
- published to PyPI.
5
-
6
- ## Quick start
7
-
8
- ```bash
9
- uv sync --group dev
10
- uv run pytest
11
- ```
12
-
13
- ## Project layout
14
-
15
- ```
16
- .
17
- ├── .github/workflows/ # CI, Claude review, release-please, publish
18
- ├── src/ # library code (src/ layout)
19
- ├── tests/ # pytest tests
20
- ├── pyproject.toml # single source of truth: build, deps, ruff, pytest, tox
21
- ├── .pre-commit-config.yaml
22
- ├── commitlint.config.js
23
- └── CHANGELOG.md # managed by release-please
24
- ```
25
-
26
- ## Development
27
-
28
- ```bash
29
- # Install hooks (runs ruff + ty pre-commit, conventional commit-msg)
30
- uv run pre-commit install --hook-type pre-commit --hook-type commit-msg
31
-
32
- # Run the full test matrix (3.11, 3.12, 3.13)
33
- uv run tox
34
-
35
- # Single env
36
- uv run tox -e py313 -- -k calculator
37
-
38
- # Lint / format check / type check
39
- uv run ruff check .
40
- uv run ruff format --check .
41
- uv run ty check src
42
- ```
43
-
44
- ## Commits
45
-
46
- Every commit MUST follow the
47
- [Conventional Commits](https://www.conventionalcommits.org/) specification.
48
-
49
- Examples:
50
- - `feat: add support for negative numbers`
51
- - `fix(calculator): correct divide by zero error`
52
- - `chore(deps): bump ruff to 0.9`
53
- - `feat!: drop Python 3.10 support` (breaking change → major bump)
54
-
55
- Enforced locally by `conventional-pre-commit` (commit-msg hook) and in CI by
56
- `commitlint`.
57
-
58
- ## Release flow
59
-
60
- ```
61
- PR opened ──▶ ci.yml (lint, ty, pytest matrix, commitlint)
62
- │
63
- └─ optional: comment "@claude" ──▶ claude-review.yml
64
-
65
- PR merged ──▶ main ──▶ release-please.yml
66
- │
67
- └─ creates/updates a "Release PR"
68
- (bumps version, regenerates CHANGELOG)
69
-
70
- Release PR merged ──▶ release-please tags + creates GitHub Release
71
- │
72
- └─ publish.yml ──▶ uv build
73
- ──▶ TestPyPI (OIDC)
74
- ──▶ PyPI (OIDC, gated env)
75
- ```
76
-
77
- ## First-time setup after cloning the template
78
-
79
- 1. Rename `name` in `pyproject.toml`, the package directory under `src/`, and
80
- imports in `tests/`.
81
- 2. Configure Trusted Publishers on
82
- [PyPI](https://docs.pypi.org/trusted-publishers/) and
83
- [TestPyPI](https://docs.pypi.org/trusted-publishers/) for your repo, pointing
84
- to the `publish.yml` workflow and the `pypi` / `testpypi` environments.
85
- 3. Create two GitHub Environments named `testpypi` and `pypi` (optionally add
86
- required reviewers on `pypi` as a manual prod gate).
87
- 4. Add an `ANTHROPIC_API_KEY` repository secret (for the Claude review
88
- workflow).
89
- 5. Settings → Actions → General → Workflow permissions → "Read and write
90
- permissions" so release-please can open PRs and push tags.