-
Notifications
You must be signed in to change notification settings - Fork 1
/
noxfile.py
executable file
·73 lines (55 loc) · 1.61 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from __future__ import absolute_import
import os
import shutil
import nox
BLACK_PATHS = ("docs", "pysecretary", "tests", "noxfile.py", "setup.py")
def default(session):
session.install(
"pytest", "pytest-cov",
)
# Run py.test against the unit tests.
session.run(
"py.test",
"--quiet",
"--cov=pysecretary",
"--cov=tests",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
*session.posargs,
)
@nox.session(python=["3.5", "3.6", "3.7", "3.8"])
def unit(session):
"""Run the unit test suite."""
default(session)
@nox.session(python=["3.8"])
def lint(session):
session.install("black")
session.install("-e", ".")
session.run("black", "--check", *BLACK_PATHS)
@nox.session(python=["3.8"])
def lint_setup_py(session):
session.run("python", "setup.py", "check", "--strict")
@nox.session(python=["3.8"])
def blacken(session):
session.install("black")
session.run("black", *BLACK_PATHS)
@nox.session(python=["3.8"])
def docs(session):
"""Build the docs."""
session.install("recommonmark", "sphinx", "sphinx_rtd_theme")
session.install("-e", ".[all]")
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
session.run(
"sphinx-build",
"-W", # warnings as errors
"-T", # show full traceback on exception
"-N", # no colors
"-b",
"html",
"-d",
os.path.join("docs", "_build", "doctrees", ""),
os.path.join("docs", ""),
os.path.join("docs", "_build", "html", ""),
)