-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
executable file
·127 lines (98 loc) · 2.7 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
"""
Current issues:
"""
# 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",
"pytest",
"coverage",
)
locations = "csv_labeler", "tests", "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", "csv_labeler")
@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")
@nox.session(python=False)
def pytest(session):
session.run(
"pytest",
"--timeout=15",
"--capture=sys",
"--junitxml=pytest-report.xml",
"--cov=csv_labeler",
"--cov-fail-under=36",
"tests/",
) # in order to see output to stdout set: --capture=tee-sys
@nox.session(python=False)
def coverage(session):
session.run("coverage", "xml")
@nox.session(python=False)
def pytest_o(session):
session.run(
"pytest",
"--capture=tee-sys",
"tests/",
)
@nox.session(python=False)
def pytest_integration(session):
session.run(
"pytest",
"--timeout=15",
"--capture=sys",
"tests/integration/",
) # in order to see output to stdout set: --capture=tee-sys