Skip to content

Commit

Permalink
Test Python 3.12 and fix its installation (#453)
Browse files Browse the repository at this point in the history
* Test Python 3.12

* Bump CI actions

* Bump setuptools and versioningit

* Add 3.12 nox session

* Add type-hints to noxfile.py
  • Loading branch information
basnijholt authored Apr 10, 2024
1 parent 5a5d1de commit 8def2c2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-changelog-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: pip install nox
- name: Test with nox
run: nox -e coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
6 changes: 3 additions & 3 deletions .github/workflows/nox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Register Python problem matcher
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/typeguard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
typeguard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
Expand Down
13 changes: 9 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
"""Nox configuration file."""

import nox


@nox.session(python=["3.9", "3.10", "3.11"])
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
@nox.parametrize("all_deps", [True, False])
def pytest(session, all_deps):
def pytest(session: nox.Session, all_deps: bool) -> None:
"""Run pytest with optional dependencies."""
session.install(".[testing,other]" if all_deps else ".[testing]")
session.run("coverage", "erase")
session.run("pytest")


@nox.session(python="3.11")
def pytest_typeguard(session):
def pytest_typeguard(session: nox.Session) -> None:
"""Run pytest with typeguard."""
session.install(".[testing,other]")
session.run("coverage", "erase")
session.run("pytest", "--typeguard-packages=adaptive")


@nox.session(python="3.11")
def coverage(session):
def coverage(session: nox.Session) -> None:
"""Generate coverage report."""
session.install("coverage")
session.install(".[testing,other]")
session.run("pytest")
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools ~= 65.0.0", "versioningit ~= 2.2.0", "wheel"]
requires = ["setuptools ~= 69.0.0", "versioningit ~= 3.0.0", "wheel"]

[project]
name = "adaptive"
Expand All @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"scipy",
Expand Down

0 comments on commit 8def2c2

Please sign in to comment.