From a2b26a2f7980c6f7621b30f1ef1360eb889fa43d Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Wed, 10 Apr 2024 12:58:42 -0400 Subject: [PATCH] Add Python 3.12 support - Include Python 3.12 classifier in PyPI package - Build and publish PyPI package using Python 3.12 - Run tests with Python 3.12, in addition to 3.10-3.11 https://docs.python.org/3/whatsnew/3.12.html --- .github/workflows/ci.yml | 6 +++--- pyproject.toml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 940bfe1..0584a5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12"] env: HATCH_ENV: "ci" HATCH_VERSION: "1.9.4" @@ -55,7 +55,7 @@ jobs: *) echo "Incorrect Hatch virtualenv." && exit 1 ;; esac - name: Test that Git tag version and Python package version match - if: github.ref_type == 'tag' && matrix.python-version == '3.11' + if: github.ref_type == 'tag' && matrix.python-version == '3.12' run: | GIT_TAG_VERSION=$GITHUB_REF_NAME PACKAGE_VERSION=$(hatch version) @@ -75,5 +75,5 @@ jobs: - name: Build Python package run: hatch build - name: Publish Python package to PyPI - if: github.ref_type == 'tag' && matrix.python-version == '3.11' + if: github.ref_type == 'tag' && matrix.python-version == '3.12' run: hatch publish -n -u __token__ -a ${{ secrets.PYPI_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index fc94635..fb4cdc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Typing :: Typed", ] dependencies = []