Skip to content

Commit 8d0638b

Browse files
committed
simplify setup
1 parent b2facbf commit 8d0638b

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/nox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ jobs:
2525
- name: Register Python problem matcher
2626
run: echo "::add-matcher::.github/workflows/matchers/pytest.json"
2727
- name: Test with nox using minimal dependencies
28-
run: uv run --group nox nox -e "pytest-${{ matrix.python-version }}(all_deps=False)"
28+
run: uv run --group nox nox -e "pytest_min_deps-${{ matrix.python-version }}"
2929
- name: Test with nox with all dependencies
30-
run: uv run --group nox nox -e "pytest-${{ matrix.python-version }}(all_deps=True)"
30+
run: uv run --group nox nox -e "pytest_all_deps-${{ matrix.python-version }}"

noxfile.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@
44

55
nox.options.default_venv_backend = "uv"
66

7+
python = ["3.9", "3.10", "3.11", "3.12"]
78

8-
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
9-
@nox.parametrize("all_deps", [True, False])
10-
def pytest(session: nox.Session, all_deps: bool) -> None:
11-
"""Run pytest with optional dependencies."""
12-
session.install(".[test,other]" if all_deps else ".[test]")
9+
10+
@nox.session(python=python)
11+
def pytest_min_deps(session: nox.Session) -> None:
12+
"""Run pytest with no optional dependencies."""
13+
session.install(".[test]")
14+
session.run("coverage", "erase")
15+
session.run("pytest")
16+
17+
18+
@nox.session(python=python)
19+
def pytest_all_deps(session: nox.Session) -> None:
20+
"""Run pytest with "other" optional dependencies."""
21+
session.install(".[test,other]")
1322
session.run("coverage", "erase")
1423
session.run("pytest")
1524

0 commit comments

Comments
 (0)