-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
50 lines (37 loc) · 1.07 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
import nox
nox.options.stop_on_first_error = True
nox.options.reuse_existing_virtualenvs = True
nox.options.keywords = "not serve"
source_files = ("chronicle", "tests", "setup.py", "noxfile.py")
def install_dependencies(session):
session.install(
"--upgrade",
"-r",
"install/requirements/dev.txt",
"-r",
"install/requirements/base.txt",
)
# Install project
session.install("-e", ".")
@nox.session
def lint(session):
install_dependencies(session)
session.run("flake8", *source_files)
session.run("black", "--target-version=py36", *source_files)
check(session)
@nox.session
def check(session):
install_dependencies(session)
session.run(
"black",
"--check",
"--diff",
"--target-version=py36",
*source_files,
success_codes=[0, 1]
)
session.run("flake8", *source_files)
@nox.session(python=["3", "3.6", "3.7", "3.8"])
def test(session):
install_dependencies(session)
session.run("python", "-m", "pytest", "-v", "--cov=chronicle", "tests")