Skip to content

Commit d2f34ec

Browse files
committed
Reorganize noxfile.py
1 parent a7cb797 commit d2f34ec

1 file changed

Lines changed: 33 additions & 7 deletions

File tree

‎noxfile.py‎

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
1-
"""Experimental nox configuration file."""
1+
"""
2+
Configuration file for nox.
3+
4+
To see the list of available environments, run:
5+
6+
nox --list
7+
8+
To run an environment, use:
9+
10+
nox -e <environment>
11+
12+
where `<environment>` is the name of the environment to run.
13+
"""
214

315
import nox
416

5-
nox.options.default_venv_backend = "uv"
17+
supported_python_versions = ("3.10", "3.11", "3.12")
18+
19+
minpython = min(supported_python_versions)
20+
maxpython = max(supported_python_versions)
621

22+
doc_requirements = ("-r", "ci_requirements/requirements_docs_py312.txt")
723

8-
maxpython = "3.12"
924

10-
doc_requirements = ("-r", "requirements/requirements_docs_py312.txt")
25+
nox.options.default_venv_backend = "uv|virtualenv"
26+
27+
28+
@nox.session(python=supported_python_versions)
29+
def tests(session):
30+
"""Run tests with pytest."""
31+
32+
33+
# Documentation builds
1134

1235
sphinx_commands = (
1336
"sphinx-build",
@@ -22,23 +45,26 @@
2245
check_hyperlinks = ("-b", "linkcheck", "-q")
2346

2447

25-
@nox.session(python=maxpython)
48+
@nox.session(python=supported_python_versions[-1])
2649
def docs(session):
2750
"""Build documentation with Sphinx."""
2851
session.install(*doc_requirements)
2952
session.install(".")
3053
session.run(*sphinx_commands, *html, *session.posargs)
3154

3255

33-
@nox.session(python=maxpython)
56+
@nox.session(python=supported_python_versions[-1])
3457
def linkcheck(session):
3558
"""Check hyperlinks in documentation."""
3659
session.install(*doc_requirements)
3760
session.install(".")
3861
session.run(*sphinx_commands, *check_hyperlinks, *session.posargs)
3962

4063

41-
@nox.session(python=maxpython)
64+
# Static type checking
65+
66+
67+
@nox.session(python=supported_python_versions[-1])
4268
def mypy(session):
4369
"""Perform static type checking with mypy."""
4470
mypy_command = ("mypy", ".")

0 commit comments

Comments
 (0)