Skip to content

Commit ca5f16a

Browse files
authored
Merge pull request #212 from gpauloski/gpauloski/releases
Update release process and dynamic versioning
2 parents d857a48 + 623d8fc commit ca5f16a

8 files changed

Lines changed: 27 additions & 48 deletions

File tree

.github/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ changelog:
33
labels:
44
- ignore-for-release
55
authors:
6-
- pre-commit-ci
6+
- pre-commit-ci[bot]
77
categories:
88
# Provide steps for upgrading the package and adjusting for
99
# breaking changes. No PRs included here.

.github/workflows/publish.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,18 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919

20-
- name: Extract package version from pyproject.toml
20+
- name: Extract version from tag
2121
run: |
22-
echo "PACKAGE_VERSION=$(grep -Po '^version\s*=\s*\"\K.*?(?=\")' pyproject.toml)" >> $GITHUB_ENV
23-
echo "Found version in pyproject.toml: ${{ env.PACKAGE_VERSION }}"
22+
# Removes 'v' prefix from tag (e.g., v1.0.0 -> 1.0.0)
23+
VERSION=${GITHUB_REF_NAME#v}
24+
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
25+
echo "Extracted version from tag: $VERSION"
2426
2527
- name: Check package version is PEP440 compliant
2628
# This is only a partial PEP440 match, it just checks the major, minor
2729
# patch, but not any optional suffixes.
2830
run: echo "${{ env.PACKAGE_VERSION }}" | grep -P "^\d+\.\d+\.\d+.*$"
2931

30-
- name: Check version matches release tag
31-
run: |
32-
if [ "${{ format('v{0}', env.PACKAGE_VERSION) }}" != "${{ github.event.release.tag_name }}" ]
33-
then
34-
echo "v\$\{PACKAGE_VERSION\} = v${{ env.PACKAGE_VERSION }} does not match tag name: ${{ github.event.release.tag_name }}"
35-
exit 1
36-
fi
37-
3832
- name: Setup Python 3.11
3933
uses: actions/setup-python@v6
4034
with:

.github/workflows/tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
strategy:
1515
matrix:
1616
include:
17-
- os: ubuntu-latest
18-
python: '3.9'
19-
toxenv: py39
2017
- os: ubuntu-latest
2118
python: '3.10'
2219
toxenv: py310

CITATION.cff

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/contributing/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ $ . venv/bin/activate
1616

1717
Running Tox in a Conda environment is possible but it may conflict with
1818
Tox's ability to find the correct Python versions. E.g., if your
19-
Conda environment is Python 3.9, running `#!bash $ tox -e p38` may still use
20-
Python 3.9.
19+
Conda environment is Python 3.13, running `#!bash $ tox -e p312` may still use
20+
Python 3.13.
2121

2222
To install manually:
2323
```bash
@@ -61,9 +61,9 @@ Code that is useful for building tests but is not a test itself belongs in the
6161

6262
```bash
6363
# Run all tests in tests/
64-
$ tox -e py39
64+
$ tox -e py313
6565
# Run a specific test
66-
$ tox -e py39 -- tests/x/y_test.py::test_z
66+
$ tox -e py313 -- tests/x/y_test.py::test_z
6767
```
6868

6969
## Docs

docs/contributing/releases.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@ Milestones are the [Issue Tracker](https://github.com/foobar-author/foobar/issue
1010
(`major.minor.patch`) with optional [PEP-440](https://peps.python.org/pep-0440){target=_blank}
1111
pre-release/post-release/dev-release segments. Major/minor/patch numbers
1212
start at 0 and pre-release/post-release/dev-release segments start at 1.
13-
2. Update the version in `pyproject.toml` to `{VERSION}`.
14-
3. Commit and merge the version updates/changelogs into main.
15-
4. Tag the release commit and push (typically this is the commit updating the
16-
version numbers).
13+
1. Tag the release commit and push.
1714
```bash
1815
$ git tag -s v{VERSION} -m "FooBar v{VERSION}"
1916
$ git push origin v{VERSION}
2017
```
21-
Note the version number is prepended by "v" for the tags so we can
18+
Note the version number is prepended by "v" for the tags so tooling can
2219
distinguish release tags from non-release tags.
2320
5. Create a new release on GitHub using the tag. The title should be
2421
`FooBar v{VERSION}`.

pyproject.toml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
[build-system]
2-
requires = ["setuptools>=64.0", "setuptools_scm"]
2+
requires = ["setuptools>=77.0", "setuptools_scm"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "foobar"
7-
version = "0.1.0"
87
authors = [
9-
{name = "foobar author"},
10-
{email = "foobar@foobar.com"},
8+
{name = "foobar author", email = "foobar@foobar.com"},
119
]
12-
description = "Foobar example package."
10+
description = "Foobar example package"
11+
dynamic = ["version"]
1312
readme = "README.md"
14-
requires-python = ">=3.9"
15-
license = {text = "MIT"}
13+
requires-python = ">=3.10"
14+
license = "MIT"
15+
license-files = ["LICENSE"]
1616
classifiers = [
17-
"License :: OSI Approved :: MIT License",
1817
"Programming Language :: Python :: 3",
1918
"Programming Language :: Python :: 3 :: Only",
2019
"Programming Language :: Python :: Implementation :: CPython",
@@ -24,9 +23,9 @@ dependencies = [
2423
]
2524

2625
[project.urls]
27-
homepage = "https://github.com/foobar-author/foobar"
28-
documentation = "https://foobar.readthedocs.io"
29-
repository = "https://github.com/foobar-author/foobar"
26+
Homepage = "https://github.com/foobar-author/foobar"
27+
Documentation = "https://foobar.readthedocs.io"
28+
Source = "https://github.com/foobar-author/foobar"
3029

3130
[project.optional-dependencies]
3231
dev = [
@@ -68,7 +67,7 @@ plugins = ["covdefaults"]
6867
omit = ["examples"]
6968

7069
[tool.mypy]
71-
python_version = "3.12"
70+
python_version = "3.10"
7271
check_untyped_defs = true
7372
disallow_any_generics = true
7473
disallow_incomplete_defs = true
@@ -90,7 +89,7 @@ allow_untyped_defs = true
9089

9190
[tool.ruff]
9291
line-length = 79
93-
target-version = "py39"
92+
target-version = "py310"
9493

9594
[tool.ruff.format]
9695
indent-style = "space"
@@ -162,3 +161,5 @@ convention = "google"
162161
[tool.setuptools.packages.find]
163162
exclude = ["tests*", "testing*"]
164163
namespaces = false
164+
165+
[tool.setuptools_scm]

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py39, py310, py311, py312, py313, pre-commit, docs
2+
envlist = py310, py311, py312, py313, pre-commit, docs
33

44
[testenv]
55
extras = dev

0 commit comments

Comments
 (0)