-
Notifications
You must be signed in to change notification settings - Fork 191
/
noxfile.py
56 lines (40 loc) · 1.36 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
"""Automation using nox.
"""
import nox
nox.options.sessions = ["dev"]
nox.options.reuse_existing_virtualenvs = True
nox.options.error_on_external_run = True
@nox.session(python="3")
def dev(session):
session.install("-r", "requirements.txt")
session.run("python", "manage.py", *session.posargs)
@nox.session(python="3")
def gunicorn(session):
session.install("-r", "requirements.txt")
session.run("python", "manage.py", "collectstatic", "--noinput")
session.run("gunicorn", "-c", "gunicorn.conf.py")
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
def test(session):
session.install("-r", "requirements.txt")
session.install("-r", "tools/requirements-test.txt")
session.run("pytest", "--cov", "-v", "--tb=native")
session.run("coverage", "report", "-m")
@nox.session(python=["3.5", "3.6", "3.7", "3.8"])
def lint(session):
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files")
@nox.session(python="3.5")
def docs(session):
session.install("-r", "tools/requirements-docs.txt")
def get_sphinx_build_command(kind):
return [
"sphinx-build",
"-W",
"-d",
"docs/build/_doctrees/" + kind,
"-b",
kind,
"docs/source",
"docs/build/" + kind,
]
session.run(*get_sphinx_build_command("html"))