-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
51 lines (39 loc) · 1.43 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
45
46
47
48
49
50
51
from pathlib import Path
import nox
nox.options.sessions = ["clean", "test", "report", "docs"]
nox.options.reuse_existing_virtualenvs = True
@nox.session(python="python3.10")
def clean(session):
session.run_always("poetry", "install", "--with=dev", external=True)
session.env["TOP"] = str(Path(__file__).parent)
session.run("coverage", "erase")
@nox.session(python="python3.10")
def mypy(session):
session.install("poetry")
session.run("poetry", "install", "--with=dev")
session.run("mypy", "src", "tests")
@nox.session(python=["3.9", "3.10", "3.11"])
def test(session):
session.run_always("poetry", "install", "--with=dev", external=True)
session.env["COVERAGE_PROCESS_START"] = str(
Path(__file__).parent / "pyproject.toml"
)
session.env["TOP"] = str(Path(__file__).parent)
session.run(
"pytest", "--doctest-modules", "src/codecrumbs", "tests", *session.posargs
)
@nox.session(python="python3.10")
def report(session):
session.run_always("poetry", "install", "--with=dev", external=True)
session.env["TOP"] = str(Path(__file__).parent)
try:
session.run("coverage", "combine")
except:
pass
session.run("coverage", "html")
session.run("coverage", "report", "--fail-under", "94")
@nox.session(python="python3.10")
def docs(session):
session.install("poetry")
session.run("poetry", "install", "--with=doc")
session.run("mkdocs", "build")