-
Notifications
You must be signed in to change notification settings - Fork 2
/
noxfile.py
34 lines (26 loc) · 994 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
import nox
@nox.session
@nox.parametrize(
"python, django",
[
(python, django)
for python in ("3.7", "3.8", "3.9", "3.10", "3.11")
for django in ("3.2", "4.0", "4.1", "4.2")
if (python, django) not in [("3.7", "4.0"), ("3.7", "4.1"), ("3.7", "4.2")]
],
)
def tests(session, django):
session.run("poetry", "install", external=True)
session.install(f"django=={django}")
session.run("pytest", "--cov", "--cov-report=xml")
lint_dirs = ["src", "tests", "example_project"]
@nox.session(python=["3.7"])
def types(session):
session.run("poetry", "install", external=True)
session.run("mypy", ".", external=True)
@nox.session(python=["3.7"])
def formatting(session):
session.run("poetry", "install", external=True)
session.run("flake8", *lint_dirs)
session.run("isort", "--check-only", "--diff", "--force-single-line-imports", "--profile", "black", *lint_dirs)
session.run("black", "--check", "--diff", *lint_dirs)