-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
59 lines (45 loc) · 1.47 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
from typing import List
import nox
DEFAULT_PYTHON_VERSION: str = '3'
SUPPORTED_PYTHON_VERSIONS: List[str] = [
'3.6',
'3.7',
'3.8',
'3.9',
'3.10',
'pypy3',
'pypy-3.6',
'pypy-3.7',
]
nox.options.reuse_existing_virtualenvs = True # type: ignore
@nox.session(python=SUPPORTED_PYTHON_VERSIONS)
def test(session: nox.Session):
session.install('-r', 'requirements.txt')
session.install('-r', 'requirements-test.txt')
session.run('pytest',
'--no-header',
'./tests/',
external=False)
@nox.session(python=DEFAULT_PYTHON_VERSION)
def mypy(session: nox.Session):
session.install('mypy')
session.run('mypy', '-p', 'snr', '-p', 'tests')
@nox.session(python=DEFAULT_PYTHON_VERSION)
def pytype(session: nox.Session):
session.install('pytype')
session.install('-r', 'requirements.txt')
session.run('pytype')
@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session: nox.Session):
session.install('flake8')
session.run('flake8', 'snr', 'tests')
@nox.session(python=SUPPORTED_PYTHON_VERSIONS)
def bench(session: nox.Session):
session.install('-r', 'requirements.txt')
session.install('-r', 'requirements-test.txt')
session.run('python', '-m', 'unittest',
'-q',
'tests.bench.bench_node_startup',
'tests.bench.bench_stress_endpoint_fac',
'tests.bench.bench_stress_loop_fac',
external=False)