-
Notifications
You must be signed in to change notification settings - Fork 1
/
noxfile.py
71 lines (56 loc) · 1.87 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
import nox
nox.options.stop_on_first_error = True
nox.options.reuse_existing_virtualenvs = True
nox.options.keywords = "not serve"
nox.options.install_cache = "180"
source_files = ("lib/saveme", "tools", "tests", "setup.py", "noxfile.py")
@nox.session
def lint(session):
session.install(
"--upgrade", "autoflake", "black", "flake8", "isort", "seed-isort-config"
)
session.run("autoflake", "--in-place", "--recursive", *source_files)
session.run(
"seed-isort-config",
"--application-directories=lib/saveme",
success_codes=[0, 1],
)
session.run("isort", "--project=saveme", "--recursive", "--apply", *source_files)
session.run("black", "--target-version=py36", *source_files)
check(session)
@nox.session
def check(session):
session.install(
"--upgrade",
"black",
"flake8",
"flake8-bugbear",
"flake8-comprehensions",
"flake8-pie",
"isort",
"mypy",
)
session.run("black", "--check", "--diff", "--target-version=py36", *source_files)
session.run("flake8", *source_files)
session.run("mypy", "lib/saveme")
session.run(
"isort", "--check", "--diff", "--project=saveme", "--recursive", *source_files,
)
@nox.session
def docs(session):
session.install(
"--upgrade", "mkdocs", "mkdocs-material", "mkautodoc>=0.1.0", "snakefood3"
)
session.install("-e", ".")
session.run("mkdocs", "build")
@nox.session(reuse_venv=True)
def serve(session):
session.install(
"--upgrade", "mkdocs", "mkdocs-material", "mkautodoc>=0.1.0", "snakefood3"
)
session.install("-e", ".")
session.run("mkdocs", "serve")
@nox.session(python=["3.6", "3.7", "3.8"])
def test(session):
session.install("--upgrade", "-r", "test-requirements.txt")
session.run("nosetests", "--with-coverage", "tests/python.py", *session.posargs)