-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
35 lines (26 loc) · 1.05 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
import nox
nox.options.sessions = ["lint", "typing", "tests"]
locations = ["noxfile.py", "setup.py", "digaws/", "tests/"]
lint_common_args = ["--max-line-length", "100"]
black_args = ["--line-length", "100"]
mypy_args = ["--ignore-missing-imports", "--install-types", "--non-interactive"]
pytest_args = ["--cov=digaws", "--cov-report=", "tests/"]
coverage_args = ["report", "--show-missing", "--fail-under=80"]
@nox.session()
def lint(session):
args = session.posargs or locations
session.install("pycodestyle", "flake8", "black")
session.run("pycodestyle", *(lint_common_args + args))
session.run("flake8", *(lint_common_args + args))
session.run("black", "--check", *(black_args + args))
@nox.session()
def typing(session):
args = session.posargs or locations
session.install("mypy")
session.run("mypy", *(mypy_args + args))
@nox.session()
def tests(session):
args = session.posargs
session.install("-r", "requirements_test.txt")
session.run("pytest", *(pytest_args + args))
session.run("coverage", *coverage_args)