-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
38 lines (28 loc) · 901 Bytes
/
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
import nox
nox.options.sessions = 'lint', 'tests'
file_locations = 'src',
@nox.session(python='3.8')
def coverage(session):
session.install('coverage[toml]', 'codecov')
session.run('coverage', 'xml', '--fail-under=0')
session.run('codecov', *session.posargs)
@nox.session(python='3.8')
def lint(session):
flake8_args = session.posargs or file_locations
session.install(
'darglint',
'flake8',
'flake8-black',
'flake8-docstrings',
)
session.run('flake8', *flake8_args)
@nox.session(python=['3.8', '3.7'])
def mypy(session):
mypy_args = session.posargs or file_locations
session.install('mypy')
session.run('mypy', *mypy_args)
@nox.session(python=['3.8', '3.7'])
def tests(session):
pytest_args = session.posargs or ['--cov']
session.run('poetry', 'install', external=True)
session.run('pytest', *pytest_args)