-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
68 lines (54 loc) · 1.6 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
from nox_poetry import Session, session
@session()
def tests(session: Session) -> None:
args = session.posargs or ["--cov=recite", "--cov-report=xml"]
session.install(".[all]")
session.install("pytest")
session.install("pytest-cov")
session.install("pytest-mock")
session.run("pytest", *args)
locations = ["src", "tests", "noxfile.py"]
@session()
def lint(session: Session) -> None:
args = session.posargs or locations
session.install("black", "isort")
session.run("black", *args)
session.run("isort", *args)
@session()
def style_checking(session: Session) -> None:
args = session.posargs or locations
session.install(
"pyproject-flake8",
"flake8-eradicate",
"flake8-isort",
"flake8-debugger",
"flake8-comprehensions",
"flake8-print",
"flake8-black",
"flake8-bugbear",
"darglint",
"pydocstyle",
)
session.run("pflake8", "--docstring-style", "sphinx", *args)
@session()
def pyroma(session: Session) -> None:
session.install("poetry-core>=1.0.0")
session.install("pyroma")
session.run("pyroma", "--min", "10", ".")
@session()
def type_checking(session: Session) -> None:
args = session.posargs or locations
session.install("mypy")
session.run(
"mypy",
"--install-types",
"--non-interactive",
"--ignore-missing-imports",
*args
)
@session()
def build_docs(session: Session) -> None:
session.install(".")
session.install("mkdocs")
session.install("mkdocs-material")
session.run("mkdocs", "build", external=True)