Skip to content

Commit

Permalink
Run tests against and build wheels for Python 3.13.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmerry committed Oct 31, 2024
1 parent 0a74d7f commit a040700
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 12 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
Expand Down Expand Up @@ -244,7 +248,7 @@ jobs:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
python: [cp38, cp39, cp310, cp311, cp312]
python: [cp38, cp39, cp310, cp311, cp312, cp313]
env:
SCCACHE_GHA_ENABLED: "true"
steps:
Expand Down Expand Up @@ -274,7 +278,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-13, macos-14]
python: [cp38, cp39, cp310, cp311, cp312]
python: [cp38, cp39, cp310, cp311, cp312, cp313]
exclude:
# Python 3.8 not natively available for Apple Silicon. cibuildwheel
# tries to do a cross build, which fails.
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ repos:
args: [requirements.in, -o, requirements-3.12.txt]
language_version: python3.12
files: '^(?:requirements\.in|requirements-3\.12\.txt)$'
- name: pip-compile (py 3.13)
id: pip-compile
args: [requirements.in, -o, requirements-3.13.txt]
language_version: python3.13
files: '^(?:requirements\.in|requirements-3\.13\.txt)$'
- name: pip-compile (readthedocs)
id: pip-compile
args: [requirements-readthedocs.in, -o, requirements-readthedocs.txt]
Expand Down
12 changes: 7 additions & 5 deletions doc/dev-setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ of editable installs. Also install the development runtime dependencies:
.. code-block:: sh
pip install -r requirements.txt # If Python < 3.12
pip install -r requirements-3.12.txt # If Python >= 3.12
pip install -r requirements-3.12.txt # If Python = 3.12
pip install -r requirements-3.13.txt # If Python >= 3.13
Now you should be able to run the unit tests by executing :command:`pytest`.
It is expected that some tests will be skipped, because they require specific
Expand Down Expand Up @@ -142,10 +143,11 @@ Committing
----------
Before committing, remember to run :command:`pre-commit install` to set up
pre-commit. One of the pre-commit hooks checks that the requirements files are
up to date, and (at the time of writing) depends on having both
:command:`python3.8` and :command:`python3.12` commands on the path. If you're
not touching the requirements, you can skip this hook by setting the
environment variable :envvar:`SKIP=pip-compile` when committing.
up to date, and (at the time of writing) depends on having
:command:`python3.8`, :command:`python3.12` and :command:`python3.13` commands
on the path. If you're not touching the requirements, you can skip this hook
by setting the environment variable :envvar:`SKIP=pip-compile` when
committing.

.. _ninja-build: https://ninja-build.org/
.. _pyenv: https://github.com/pyenv/pyenv/
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ py_version = 38

[tool.black]
line-length = 100
target-versions = ["py38", "py39", "py310", "py311", "py312"]
target-versions = ["py38", "py39", "py310", "py311", "py312", "py313"]

[tool.ruff]
select = ["E", "F", "W", "UP", "PYI", "RUF100"]
Expand Down
2 changes: 1 addition & 1 deletion requirements-3.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ llvmlite==0.43.0
# via numba
netifaces2==0.0.22
# via -r requirements.in
numba==0.60.0
numba==0.60.0 ; python_version < "3.13"
# via -r requirements.in
numpy==2.0.2
# via
Expand Down
32 changes: 32 additions & 0 deletions requirements-3.13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --output-file=requirements-3.13.txt requirements.in
#
iniconfig==2.0.0
# via pytest
netifaces2==0.0.22
# via -r requirements.in
numpy==2.1.2
# via
# -r requirements.in
# scipy
packaging==24.1
# via pytest
pluggy==1.5.0
# via pytest
pytest==8.3.3
# via
# -r requirements.in
# pytest-asyncio
# pytest-custom-exit-code
# pytest-timeout
pytest-asyncio==0.24.0
# via -r requirements.in
pytest-custom-exit-code==0.3.0
# via -r requirements.in
pytest-timeout==2.3.1
# via -r requirements.in
scipy==1.14.1
# via -r requirements.in
2 changes: 1 addition & 1 deletion requirements-readthedocs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ markupsafe==2.1.5
# via jinja2
netifaces2==0.0.22
# via -r requirements-3.12.txt
numba==0.60.0
numba==0.60.0 ; python_version < "3.13"
# via -r requirements-3.12.txt
numpy==2.0.2
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
netifaces2
numba
numba; python_version<"3.13" # numba doesn't yet support 3.13
numpy
pytest
pytest-asyncio
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ llvmlite==0.41.1
# via numba
netifaces2==0.0.22
# via -r requirements.in
numba==0.58.1
numba==0.58.1 ; python_version < "3.13"
# via -r requirements.in
numpy==1.24.4
# via
Expand Down

0 comments on commit a040700

Please sign in to comment.