|
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 | +""" |
2 | 14 |
|
3 | 15 | import nox |
4 | 16 |
|
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) |
6 | 21 |
|
| 22 | +doc_requirements = ("-r", "ci_requirements/requirements_docs_py312.txt") |
7 | 23 |
|
8 | | -maxpython = "3.12" |
9 | 24 |
|
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 |
11 | 34 |
|
12 | 35 | sphinx_commands = ( |
13 | 36 | "sphinx-build", |
|
22 | 45 | check_hyperlinks = ("-b", "linkcheck", "-q") |
23 | 46 |
|
24 | 47 |
|
25 | | -@nox.session(python=maxpython) |
| 48 | +@nox.session(python=supported_python_versions[-1]) |
26 | 49 | def docs(session): |
27 | 50 | """Build documentation with Sphinx.""" |
28 | 51 | session.install(*doc_requirements) |
29 | 52 | session.install(".") |
30 | 53 | session.run(*sphinx_commands, *html, *session.posargs) |
31 | 54 |
|
32 | 55 |
|
33 | | -@nox.session(python=maxpython) |
| 56 | +@nox.session(python=supported_python_versions[-1]) |
34 | 57 | def linkcheck(session): |
35 | 58 | """Check hyperlinks in documentation.""" |
36 | 59 | session.install(*doc_requirements) |
37 | 60 | session.install(".") |
38 | 61 | session.run(*sphinx_commands, *check_hyperlinks, *session.posargs) |
39 | 62 |
|
40 | 63 |
|
41 | | -@nox.session(python=maxpython) |
| 64 | +# Static type checking |
| 65 | + |
| 66 | + |
| 67 | +@nox.session(python=supported_python_versions[-1]) |
42 | 68 | def mypy(session): |
43 | 69 | """Perform static type checking with mypy.""" |
44 | 70 | mypy_command = ("mypy", ".") |
|
0 commit comments