-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
44 lines (34 loc) · 1.31 KB
/
noxfile.py
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
import nox
from nox_poetry import session
PYTHON_VERSIONS = ["3.9.13", "3.10.4"]
SPHINX_VERSIONS = ["4.5", "5.2.1", "5.2.3", "6.1.3"]
TEST_DEPENDENCIES = [
"pytest",
"pytest-xdist",
"pyparsing!=3.0.4",
]
def is_supported(python: str, sphinx: str) -> bool:
return not (python == "3.10.4" and sphinx in ["4.1"])
def run_tests(session, sphinx):
session.install(".")
session.install(*TEST_DEPENDENCIES)
session.run("pip", "install", f"sphinx=={sphinx}", silent=True)
session.run("pip", "install", "-r", "docs/requirements.txt", silent=True)
session.run("echo", "TEST FINAL PACKAGE LIST")
session.run("pip", "freeze")
session.run("make", "test", external=True)
@session(python=PYTHON_VERSIONS)
@nox.parametrize("sphinx", SPHINX_VERSIONS)
def tests(session, sphinx):
if is_supported(session.python, sphinx):
run_tests(session, sphinx)
else:
session.skip("unsupported combination")
@session(python="3.9")
def linkcheck(session):
session.install(".")
# LinkCheck cn handle rate limits since Sphinx 3.4, which is needed as
# our doc has to many links to github.
session.run("pip", "install", "sphinx==3.5.4", silent=True)
session.run("pip", "install", "-r", "docs/requirements.txt", silent=True)
session.run("make", "docs-linkcheck", external=True)