Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: pip install nox
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Test with nox
run: nox -e coverage
run: uv run --group nox nox -e coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
18 changes: 0 additions & 18 deletions .github/workflows/matchers/pytest.json

This file was deleted.

12 changes: 5 additions & 7 deletions .github/workflows/nox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Register Python problem matcher
run: echo "::add-matcher::.github/workflows/matchers/pytest.json"
- name: Install dependencies
run: pip install nox pytest-github-actions-annotate-failures
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Test with nox using minimal dependencies
run: nox -e "pytest-${{ matrix.python-version }}(all_deps=False)"
run: uv run --group nox nox -e "pytest_min_deps-${{ matrix.python-version }}"
- name: Test with nox with all dependencies
run: nox -e "pytest-${{ matrix.python-version }}(all_deps=True)"
run: uv run --group nox nox -e "pytest_all_deps-${{ matrix.python-version }}"
8 changes: 4 additions & 4 deletions .github/workflows/typeguard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install nox
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Test with nox
run: nox -e pytest_typeguard
run: uv run --group nox nox -e pytest_typeguard
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ jupyter labextension install @pyviz/jupyterlab_pyviz

## :wrench: Development

Clone the repository and run `pip install -e ".[notebook,testing,other]"` to add a link to the cloned repo into your Python path:
Clone the repository and run `pip install -e ".[notebook,test,other]"` to add a link to the cloned repo into your Python path:

```bash
git clone git@github.com:python-adaptive/adaptive.git
cd adaptive
pip install -e ".[notebook,testing,other]"
pip install -e ".[notebook,test,other]"
```

We recommend using a Conda environment or a virtualenv for package management during Adaptive development.
Expand Down
40 changes: 27 additions & 13 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,45 @@
"""Nox configuration file."""

import os

import nox

nox.options.default_venv_backend = "uv"

python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
num_cpus = os.cpu_count() or 1
xdist = ("-n", "auto") if num_cpus > 2 else ()


@nox.session(python=python)
def pytest_min_deps(session: nox.Session) -> None:
"""Run pytest with no optional dependencies."""
session.install(".[test]")
session.run("coverage", "erase")
session.run("pytest", *xdist)


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


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


@nox.session(python="3.11")
@nox.session(python="3.13")
def coverage(session: nox.Session) -> None:
"""Generate coverage report."""
session.install("coverage")
session.install(".[testing,other]")
session.run("pytest")
session.install(".[test,other]")
session.run("pytest", *xdist)

session.run("coverage", "report")
session.run("coverage", "xml")
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,18 @@ notebook = [
"matplotlib",
"plotly",
]
testing = [
test = [
"flaky",
"pytest",
"pytest-cov",
"pytest-randomly",
"pytest-timeout",
"pytest-xdist",
"pre_commit",
"typeguard",
"coverage",
]
dev = ["adaptive[test,nox,notebook,other]"]

[project.urls]
homepage = "https://adaptive.readthedocs.io/"
Expand All @@ -66,6 +69,12 @@ repository = "https://github.com/python-adaptive/adaptive"
content-type = "text/markdown"
file = "README.md"

[dependency-groups]
nox = [
"nox",
"pytest-github-actions-annotate-failures",
]

[tool.setuptools.packages.find]
include = ["adaptive.*", "adaptive"]

Expand Down
Loading