-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnoxfile.py
More file actions
64 lines (55 loc) · 2.1 KB
/
noxfile.py
File metadata and controls
64 lines (55 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
import nox
def _has_venv(session):
return not isinstance(session.virtualenv, nox.virtualenv.PassthroughEnv)
python_versions = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
sphinx_versions = {_p: ["4.5.0", "5.3.0", "6.1.3", "7.2.6", "8.2.3", "9.0.4"]
for _p in python_versions}
# These are in the full matrix, but excluded by the constraints in pyproject.toml. Not
# sure how to exclude these programmatically yet with pdm.
# https://github.com/pdm-project/pdm/issues/259#issuecomment-1407595572
excluded_versions = {
("3.7", "6.1.3"),
("3.7", "7.2.6"),
("3.7", "8.2.3"),
("3.7", "9.0.4"),
("3.8", "7.2.6"),
("3.8", "8.2.3"),
("3.8", "9.0.4"),
("3.9", "4.5.0"),
("3.9", "8.2.3"),
("3.9", "9.0.4"),
("3.10", "4.5.0"), # Fails on CI, but works on my Mac.
("3.10", "8.2.3"),
("3.10", "9.0.4"),
("3.11", "4.5.0"), # Fails on CI, but works on my Mac.
("3.12", "4.5.0"), # Fails on CI, but works on my Mac.
("3.13", "4.5.0"),
("3.13", "5.3.0"),
("3.13", "6.1.3"),
("3.14", "4.5.0"),
("3.14", "5.3.0"),
("3.14", "6.1.3"),
}
python_sphinx = [
(python, sphinx)
for python in python_versions
for sphinx in sphinx_versions[python]
if (python, sphinx) not in excluded_versions
]
@nox.session(reuse_venv=True)
@nox.parametrize("python,sphinx", python_sphinx)
def test(session, sphinx):
"""Run the test suite."""
# If a virtual environment is used, configure PDM appropriately and install
# If --no-venv is used, the install step is skipped
if _has_venv(session):
# os.environ.update({"PDM_USE_VENV": "1", "PDM_IGNORE_SAVED_PYTHON": "1"})
# session.run("pdm", "install", "-G", "tests", external=True)
# session.run("pdm", "install", "--dev", external=True)
# session.run("pdm", "run", "pip", "install", f"sphinx[test]=={sphinx}",
# external=True)
if session.python == "3.12":
session.run("python","-m", "ensurepip", "--upgrade")
session.install(".[test]", f"sphinx[test]~={sphinx}")
session.run("pytest", "tests")