-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathnoxfile.py
39 lines (27 loc) · 1.05 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
import nox
DEFAULT_PYTHON_VERSION = "3.11"
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
nox.options.sessions = [
"unit",
]
def install_dev_deps(session, robot_major_ver):
session.install("-r", f"tests/packages/{robot_major_ver}/requirements.txt")
session.install(".[dev]")
def install_doc_deps(session, robot_major_ver):
session.install("-r", f"tests/packages/{robot_major_ver}/requirements.txt")
session.install(".[doc]")
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
@nox.parametrize("robot_version", ["stable4", "stable5"])
def unit(session, robot_version):
install_dev_deps(session, robot_version)
session.run("pytest", "tests")
@nox.session(python=DEFAULT_PYTHON_VERSION)
def coverage(session):
install_dev_deps(session, "stable6")
session.install("coverage")
session.run("coverage", "run", "-m", "pytest")
session.run("coverage", "html")
@nox.session()
def docs(session):
install_doc_deps(session, "stable5")
session.run("sphinx-build", "-b", "html", "docs/source", "docs/_build/")