diff --git a/.github/release.yml b/.github/release.yml index c783b72..df8f469 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -3,7 +3,7 @@ changelog: labels: - ignore-for-release authors: - - pre-commit-ci + - pre-commit-ci[bot] categories: # Provide steps for upgrading the package and adjusting for # breaking changes. No PRs included here. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0cbb3d9..36909a9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,24 +17,18 @@ jobs: with: fetch-depth: 0 - - name: Extract package version from pyproject.toml + - name: Extract version from tag run: | - echo "PACKAGE_VERSION=$(grep -Po '^version\s*=\s*\"\K.*?(?=\")' pyproject.toml)" >> $GITHUB_ENV - echo "Found version in pyproject.toml: ${{ env.PACKAGE_VERSION }}" + # Removes 'v' prefix from tag (e.g., v1.0.0 -> 1.0.0) + VERSION=${GITHUB_REF_NAME#v} + echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV + echo "Extracted version from tag: $VERSION" - name: Check package version is PEP440 compliant # This is only a partial PEP440 match, it just checks the major, minor # patch, but not any optional suffixes. run: echo "${{ env.PACKAGE_VERSION }}" | grep -P "^\d+\.\d+\.\d+.*$" - - name: Check version matches release tag - run: | - if [ "${{ format('v{0}', env.PACKAGE_VERSION) }}" != "${{ github.event.release.tag_name }}" ] - then - echo "v\$\{PACKAGE_VERSION\} = v${{ env.PACKAGE_VERSION }} does not match tag name: ${{ github.event.release.tag_name }}" - exit 1 - fi - - name: Setup Python 3.11 uses: actions/setup-python@v6 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 61a24ac..b644edd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,9 +14,6 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - python: '3.9' - toxenv: py39 - os: ubuntu-latest python: '3.10' toxenv: py310 diff --git a/CITATION.cff b/CITATION.cff deleted file mode 100644 index 7a0f4a2..0000000 --- a/CITATION.cff +++ /dev/null @@ -1,10 +0,0 @@ -cff-version: 1.2.0 -message: If you use this software, please cite it as below. -authors: - - family-names: Pauloski - given-names: Greg - orcid: https://orcid.org/0000-0002-6547-6902 -license: MIT -repository-code: https://github.com/foobar-author/foobar -title: FooBar -url: https://foobar.dev diff --git a/docs/contributing/index.md b/docs/contributing/index.md index 956e342..6ec3975 100644 --- a/docs/contributing/index.md +++ b/docs/contributing/index.md @@ -16,8 +16,8 @@ $ . venv/bin/activate Running Tox in a Conda environment is possible but it may conflict with Tox's ability to find the correct Python versions. E.g., if your - Conda environment is Python 3.9, running `#!bash $ tox -e p38` may still use - Python 3.9. + Conda environment is Python 3.13, running `#!bash $ tox -e p312` may still use + Python 3.13. To install manually: ```bash @@ -61,9 +61,9 @@ Code that is useful for building tests but is not a test itself belongs in the ```bash # Run all tests in tests/ -$ tox -e py39 +$ tox -e py313 # Run a specific test -$ tox -e py39 -- tests/x/y_test.py::test_z +$ tox -e py313 -- tests/x/y_test.py::test_z ``` ## Docs diff --git a/docs/contributing/releases.md b/docs/contributing/releases.md index 13ba765..45dd373 100644 --- a/docs/contributing/releases.md +++ b/docs/contributing/releases.md @@ -10,15 +10,12 @@ Milestones are the [Issue Tracker](https://github.com/foobar-author/foobar/issue (`major.minor.patch`) with optional [PEP-440](https://peps.python.org/pep-0440){target=_blank} pre-release/post-release/dev-release segments. Major/minor/patch numbers start at 0 and pre-release/post-release/dev-release segments start at 1. -2. Update the version in `pyproject.toml` to `{VERSION}`. -3. Commit and merge the version updates/changelogs into main. -4. Tag the release commit and push (typically this is the commit updating the - version numbers). +1. Tag the release commit and push. ```bash $ git tag -s v{VERSION} -m "FooBar v{VERSION}" $ git push origin v{VERSION} ``` - Note the version number is prepended by "v" for the tags so we can + Note the version number is prepended by "v" for the tags so tooling can distinguish release tags from non-release tags. 5. Create a new release on GitHub using the tag. The title should be `FooBar v{VERSION}`. diff --git a/pyproject.toml b/pyproject.toml index 93648cb..b3e8266 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,19 @@ [build-system] -requires = ["setuptools>=64.0", "setuptools_scm"] +requires = ["setuptools>=77.0", "setuptools_scm"] build-backend = "setuptools.build_meta" [project] name = "foobar" -version = "0.1.0" authors = [ - {name = "foobar author"}, - {email = "foobar@foobar.com"}, + {name = "foobar author", email = "foobar@foobar.com"}, ] -description = "Foobar example package." +description = "Foobar example package" +dynamic = ["version"] readme = "README.md" -requires-python = ">=3.9" -license = {text = "MIT"} +requires-python = ">=3.10" +license = "MIT" +license-files = ["LICENSE"] classifiers = [ - "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", @@ -24,9 +23,9 @@ dependencies = [ ] [project.urls] -homepage = "https://github.com/foobar-author/foobar" -documentation = "https://foobar.readthedocs.io" -repository = "https://github.com/foobar-author/foobar" +Homepage = "https://github.com/foobar-author/foobar" +Documentation = "https://foobar.readthedocs.io" +Source = "https://github.com/foobar-author/foobar" [project.optional-dependencies] dev = [ @@ -68,7 +67,7 @@ plugins = ["covdefaults"] omit = ["examples"] [tool.mypy] -python_version = "3.12" +python_version = "3.10" check_untyped_defs = true disallow_any_generics = true disallow_incomplete_defs = true @@ -90,7 +89,7 @@ allow_untyped_defs = true [tool.ruff] line-length = 79 -target-version = "py39" +target-version = "py310" [tool.ruff.format] indent-style = "space" @@ -162,3 +161,5 @@ convention = "google" [tool.setuptools.packages.find] exclude = ["tests*", "testing*"] namespaces = false + +[tool.setuptools_scm] diff --git a/tox.ini b/tox.ini index 3250f1c..9b72e2d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py39, py310, py311, py312, py313, pre-commit, docs +envlist = py310, py311, py312, py313, pre-commit, docs [testenv] extras = dev