-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnoxfile.py
52 lines (40 loc) · 1.04 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
52
import glob
import shutil
import nox
nox.options.sessions = ["lint"]
nox.options.reuse_existing_virtualenvs = True
@nox.session
def tests(session):
session.install("-r", "tests/requirements.txt")
session.install(".")
session.run(
"pytest",
"--cov-report",
"term-missing",
"--cov",
"editables",
"tests",
*session.posargs,
)
@nox.session
def lint(session):
# Run the linters (via pre-commit)
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files", *session.posargs)
@nox.session
def build(session):
# Check the distribution
session.install("build", "twine")
session.run("pyproject-build")
session.run("twine", "check", *glob.glob("dist/*"))
@nox.session
def docs(session):
shutil.rmtree("docs/build", ignore_errors=True)
session.install("-r", "docs/requirements.txt")
session.run(
"sphinx-build",
"-b",
"html",
"docs/source", # source directory
"docs/build", # output directory
)