-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
executable file
·84 lines (65 loc) · 1.89 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
72
73
74
75
76
77
78
79
80
81
82
83
84
""" Config for 'poetry run nox'."""
# pylint: disable=missing-function-docstring, line-too-long
import nox
nox.options.sessions = (
"install", # this is mandatory to ensure, that all needed modules are installed by poetry first
"black",
"flake8",
"pylint",
"mypy",
"pytype",
"safety",
)
locations = "src", "noxfile.py"
@nox.session(python=False)
def install(session):
session.run("poetry", "install")
@nox.session(python=False)
def black(session):
args = session.posargs or locations
session.run("black", "--experimental-string-processing", *args)
@nox.session(python=False)
def flake8(session):
args = session.posargs or locations
session.run("flake8", "--docstring-convention=numpy", *args)
@nox.session(python=False)
def pylint(session):
args = session.posargs or locations
session.run("pylint", "--output-format=text", *args)
@nox.session(python=False)
def pylint_code_climate(session):
args = session.posargs or locations
session.run(
"pylint",
"--exit-zero",
"--output-format=pylint_gitlab.GitlabCodeClimateReporter",
*args
)
@nox.session(python=False)
def pylint_pages(session):
args = session.posargs or locations
session.run(
"pylint",
"--exit-zero",
"--output-format=pylint_gitlab.GitlabPagesHtmlReporter",
*args
)
@nox.session(python=False)
def mypy(session):
args = session.posargs or locations
session.run("mypy", *args)
@nox.session(python=False)
def pytype(session):
session.run("pytype", "--config=pytype.cfg", "src")
@nox.session(python=False)
def safety(session):
session.run(
"poetry",
"export",
"--dev",
"--format=requirements.txt",
"--without-hashes",
"--output=requirements.txt",
external=True,
)
session.run("safety", "check", "--file=requirements.txt", "--full-report")