Skip to content

Commit f70fd7c

Browse files
authored
feat: add support for Python 3.12 (#632)
1 parent 5d47f3c commit f70fd7c

7 files changed

Lines changed: 14 additions & 13 deletions

File tree

.github/workflows/_build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# Even though we run the build in a matrix to check against different platforms, due to a known
88
# limitation of reusable workflows that do not support setting strategy property from the caller
9-
# workflow, we only generate artifacts for ubuntu-latest and Python 3.11, which can be used to
9+
# workflow, we only generate artifacts for ubuntu-latest and Python 3.12, which can be used to
1010
# create a release. For details see:
1111
#
1212
# https://docs.github.com/en/actions/using-workflows/reusing-workflows#limitations
@@ -35,7 +35,7 @@ permissions:
3535
contents: read
3636
env:
3737
ARTIFACT_OS: ubuntu-latest # The default OS for release.
38-
ARTIFACT_PYTHON: '3.11' # The default Python version for release.
38+
ARTIFACT_PYTHON: '3.12' # The default Python version for release.
3939

4040
jobs:
4141
build:
@@ -51,7 +51,7 @@ jobs:
5151
# It is recommended to pin a Runner version specifically:
5252
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
5353
os: [ubuntu-latest, macos-latest, windows-latest]
54-
python: ['3.10', '3.11']
54+
python: ['3.10', '3.11', '3.12']
5555
steps:
5656

5757
- name: Harden Runner

.github/workflows/codeql-analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3434
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3535
language: [python]
36-
python: ['3.11']
36+
python: ['3.12']
3737
steps:
3838

3939
- name: Harden Runner

.github/workflows/pr-conventional-commits.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Python
3030
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
3131
with:
32-
python-version: '3.11'
32+
python-version: '3.12'
3333

3434
# Install Commitizen without using the package's Makefile: that's much faster than
3535
# creating a venv and installing heaps of dependencies that aren't required for this job.

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Set up Python
4545
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
4646
with:
47-
python-version: '3.11'
47+
python-version: '3.12'
4848

4949
- name: Set up Commitizen
5050
run: |
@@ -126,7 +126,7 @@ jobs:
126126
- name: Set up Python
127127
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
128128
with:
129-
python-version: '3.11'
129+
python-version: '3.12'
130130

131131
- name: Set up Commitizen
132132
run: |
@@ -250,7 +250,7 @@ jobs:
250250
# Github disallows passing environment variables as arguments to a reusable
251251
# workflow, so we have to duplicate these values here. Related discussion
252252
# here: https://github.com/actions/toolkit/issues/931
253-
artifact-name: artifact-ubuntu-latest-python-3.11
253+
artifact-name: artifact-ubuntu-latest-python-3.12
254254
git-user-name: jenstroeger
255255
git-user-email: jenstroeger@users.noreply.github.com
256256
secrets:

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif
5656
.PHONY: all
5757
all: check test dist docs
5858

59-
# Create a virtual environment, either for Python3.11 (default) or using
59+
# Create a virtual environment, either for Python3.12 (default) or using
6060
# the Python interpreter specified in the PYTHON environment variable. Also
6161
# create an empty pip.conf file to ensure that `pip config` modifies this
6262
# venv only, unless told otherwise. For more background, see:
@@ -70,8 +70,8 @@ venv:
7070
echo "Found an inactive Python virtual environment, please activate or nuke it" && exit 1; \
7171
fi
7272
if [ -z "${PYTHON}" ]; then \
73-
echo "Creating virtual environment in .venv/ for python3.11"; \
74-
python3.11 -m venv --upgrade-deps --prompt . .venv; \
73+
echo "Creating virtual environment in .venv/ for python3.12"; \
74+
python3.12 -m venv --upgrade-deps --prompt . .venv; \
7575
else \
7676
echo "Creating virtual environment in .venv/ for ${PYTHON}"; \
7777
${PYTHON} -m venv --upgrade-deps --prompt . .venv; \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The badges above give you an idea of what this project template provides. It’s
3232

3333
### Typing
3434

35-
The package requires a minimum of [Python 3.10](https://www.python.org/downloads/release/python-3109/) and supports [Python 3.11](https://www.python.org/downloads/release/python-3111/). All code requires comprehensive [typing](https://docs.python.org/3/library/typing.html). The [mypy](http://mypy-lang.org/) static type checker and the [flake8-pyi](https://github.com/PyCQA/flake8-pyi) plugin are invoked by git hooks and through a Github Action to enforce continuous type checks on Python source and [stub files](https://peps.python.org/pep-0484/#stub-files). Make sure to add type hints to your code or to use [stub files](https://mypy.readthedocs.io/en/stable/stubs.html) for types, to ensure that users of your package can `import` and type-check your code (see also [PEP 561](https://www.python.org/dev/peps/pep-0561/)).
35+
The package requires a minimum of [Python 3.10](https://www.python.org/downloads/release/python-31014/), and it supports [Python 3.11](https://www.python.org/downloads/release/python-3118/) and [Python 3.12](https://www.python.org/downloads/release/python-3121/) (default). All code requires comprehensive [typing](https://docs.python.org/3/library/typing.html). The [mypy](http://mypy-lang.org/) static type checker and the [flake8-pyi](https://github.com/PyCQA/flake8-pyi) plugin are invoked by git hooks and through a Github Action to enforce continuous type checks on Python source and [stub files](https://peps.python.org/pep-0484/#stub-files). Make sure to add type hints to your code or to use [stub files](https://mypy.readthedocs.io/en/stable/stubs.html) for types, to ensure that users of your package can `import` and type-check your code (see also [PEP 561](https://www.python.org/dev/peps/pep-0561/)).
3636

3737
### Quality assurance
3838

@@ -111,7 +111,7 @@ PYTHON=python3.10 make venv # Same virtual environment for a different Python v
111111
or manually:
112112

113113
```bash
114-
python3.11 -m venv .venv # Or use .venv311 for more than one local virtual environments.
114+
python3.12 -m venv .venv # Or use .venv312 for more than one local virtual environments.
115115
```
116116

117117
When working with this Makefile _it is important to always [activate the virtual environment](https://docs.python.org/3/library/venv.html)_ because some of the [git hooks](#git-hooks) (see below) depend on that:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ classifiers = [
2424
"Programming Language :: Python",
2525
"Programming Language :: Python :: 3.10",
2626
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
2728
"Programming Language :: Python :: 3 :: Only",
2829
"Programming Language :: Python :: Implementation :: CPython",
2930
"Topic :: Software Development :: Libraries :: Python Modules",

0 commit comments

Comments
 (0)