-
Notifications
You must be signed in to change notification settings - Fork 8
/
noxfile.py
54 lines (44 loc) · 1.27 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
import nox
@nox.session
def lint(session):
"""Checks for linting errors with flake8."""
session.install("-r", "requirements.txt")
session.run("flake8")
@nox.session
def sort(session):
"""Checks that imports are correctly sorted using isort."""
session.install("-r", "requirements.txt")
session.run("isort", ".", "--check")
@nox.session
def format(session):
"""Checks that code is correctly formatted using black."""
session.install("-r", "requirements.txt")
session.run("black", ".", "--check")
@nox.session
def types(session):
"""Check types using mypy."""
session.install("-r", "requirements.txt")
session.run("mypy", ".")
@nox.session
@nox.parametrize(
"python,django",
[
(python, django)
for python in ("3.8", "3.9", "3.10", "3.11", "3.12", "3.13")
for django in ("4.2.0", "5.0.0", "5.1.0")
if (python, django)
not in [
("3.8", "5.0.0"),
("3.8", "5.1.0"),
("3.9", "5.0.0"),
("3.9", "5.1.0"),
("3.13", "4.2.0"),
("3.13", "5.0.0"),
]
],
)
def test(session, django):
"""Runs tests with pytest."""
session.install(f"django~={django}")
session.install("-r", "requirements.txt")
session.run("pytest")