forked from Cornerstone-OnDemand/modelkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
34 lines (27 loc) · 1.1 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
import nox
@nox.session(python=["3.7", "3.8", "3.9"])
def test(session):
# Install deps and the package itself.
session.install("-r", "requirements-dev.txt")
session.run("mypy", "--install-types", "--non-interactive", "-p", "modelkit")
session.run("pytest", "--junitxml=junit.xml")
@nox.session(python=["3.7", "3.8", "3.9"])
def coverage(session):
# Install deps and the package itself.
session.install("-r", "requirements-optional.txt")
session.run("mypy", "--install-types", "--non-interactive", "-p", "modelkit")
session.run("coverage", "run", "-m", "pytest", "--junitxml=junit.xml")
session.run("coverage", "report", "-m")
session.run("coverage", "xml")
session.run("coverage", "html", "-d", "docs/coverage")
# Generate README badges using genbadge, junit.xml and coverage.xml
session.install("genbadge[coverage,tests]")
session.run(
"genbadge",
"coverage",
"-i",
"coverage.xml",
"-o",
"docs/badges/coverage.svg",
)
session.run("genbadge", "tests", "-i", "junit.xml", "-o", "docs/badges/tests.svg")