-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathnoxfile.py
55 lines (45 loc) · 1.46 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
import nox
nox.options.sessions = ("tests",)
nox.options.reuse_existing_virtualenvs = True
nox.options.error_on_external_run = True
@nox.session(python=("3.5", "3.6", "3.7", "3.8"))
@nox.parametrize("django", ("2.2", "3.0"))
def tests(session, django):
if django == "3.0" and session.python == "3.5":
session.skip()
session.install("poetry")
session.install(f"django>={django},<{django}.999")
session.install("factory-boy>=2.9.2,<2.9.99999")
session.run(
"poetry",
"install",
# this is necessary to prevent poetry from creating
# its own virtualenv
env={"VIRTUAL_ENV": session.virtualenv.location},
)
session.run("pytest")
@nox.session(python="3.8")
def docs(session):
session.install("poetry")
session.run(
"poetry",
"install",
# this is necessary to prevent poetry from creating
# its own virtualenv
env={"VIRTUAL_ENV": session.virtualenv.location},
)
session.run("sphinx-build", "docs", "docs/_build/html")
@nox.session(python=False)
def clean_docs(session):
session.run("rm", "-rf", "docs/_build")
@nox.session(python="3.8")
def release_test(session):
session.install("poetry", "twine")
session.run(
"poetry",
"build",
# this is necessary to prevent poetry from creating
# its own virtualenv
env={"VIRTUAL_ENV": session.virtualenv.location},
)
session.run("twine", "check", "dist/*")