Skip to content

Commit db67210

Browse files
chore: Update services and docs to Python 3.12 as default (#2461)
* Update to using Python 3.12 in linting and validation tools. * Update Binder runtime Python to Python 3.12. * Update Dockerfile base image to python:3.12-slim-bullseye. * Update the docs to advocate using Python 3.12 for development.
1 parent dd4a243 commit db67210

8 files changed

+16
-15
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ repos:
6464
['numpy', 'types-tqdm', 'click', 'types-jsonpatch', 'types-pyyaml', 'types-jsonschema', 'importlib_metadata', 'packaging']
6565
args: ["--python-version=3.8"]
6666
- <<: *mypy
67-
name: mypy with Python 3.11
68-
args: ["--python-version=3.11"]
67+
name: mypy with Python 3.12
68+
args: ["--python-version=3.12"]
6969

7070
- repo: https://github.com/codespell-project/codespell
7171
rev: v2.2.6

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3.11"
12+
python: "3.12"
1313
apt_packages:
1414
- curl
1515
- jq

binder/runtime.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-3.11
1+
python-3.12

codemeta.json

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"runtimePlatform": [
5151
"Python 3",
5252
"Python 3 Only",
53+
"Python 3.12",
5354
"Python 3.11",
5455
"Python 3.10",
5556
"Python 3.8",

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=python:3.11-slim-bullseye
1+
ARG BASE_IMAGE=python:3.12-slim-bullseye
22
# hadolint ignore=DL3006
33
FROM ${BASE_IMAGE} as base
44

docs/development.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ contrib module, or notebooks, and so instead to test the core codebase a develop
9797

9898
.. code-block:: console
9999
100-
nox --session tests --python 3.11
100+
nox --session tests --python 3.12
101101
102102
Contrib module matplotlib image tests
103103
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -107,7 +107,7 @@ To run the visualization tests for the ``contrib`` module with the ``pytest-mpl`
107107

108108
.. code-block:: console
109109
110-
nox --session tests --python 3.11 -- contrib
110+
nox --session tests --python 3.12 -- contrib
111111
112112
If the image files need to be regenerated, run the tests with the
113113
``--mpl-generate-path=tests/contrib/baseline`` option or just run
@@ -141,7 +141,7 @@ or pass ``coverage`` as a positional argument to the ``nox`` ``tests`` session
141141

142142
.. code-block:: console
143143
144-
nox --session tests --python 3.11 -- coverage
144+
nox --session tests --python 3.12 -- coverage
145145
146146
Coverage Report
147147
^^^^^^^^^^^^^^^

noxfile.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
import nox
66

7-
ALL_PYTHONS = ["3.8", "3.9", "3.10", "3.11"]
7+
ALL_PYTHONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
88

99
# Default sessions to run if no session handles are passed
10-
nox.options.sessions = ["lint", "tests-3.11"]
10+
nox.options.sessions = ["lint", "tests-3.12"]
1111

1212

1313
DIR = Path(__file__).parent.resolve()
@@ -30,10 +30,10 @@ def tests(session):
3030
3131
Examples:
3232
33-
$ nox --session tests --python 3.11
34-
$ nox --session tests --python 3.11 -- contrib # run the contrib module tests
35-
$ nox --session tests --python 3.11 -- tests/test_tensor.py # run specific tests
36-
$ nox --session tests --python 3.11 -- coverage # run with coverage but slower
33+
$ nox --session tests --python 3.12
34+
$ nox --session tests --python 3.12 -- contrib # run the contrib module tests
35+
$ nox --session tests --python 3.12 -- tests/test_tensor.py # run specific tests
36+
$ nox --session tests --python 3.12 -- coverage # run with coverage but slower
3737
"""
3838
session.install("--upgrade", "--editable", ".[all,test]")
3939
session.install("--upgrade", "pytest")

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ exclude_also = [
244244

245245
[tool.mypy]
246246
files = "src"
247-
python_version = "3.11"
247+
python_version = "3.12"
248248
warn_unused_configs = true
249249
strict = true
250250
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]

0 commit comments

Comments
 (0)