forked from cansarigol/pdbr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
34 lines (24 loc) · 1 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
import nox
nox.options.stop_on_first_error = True
SOURCE_FILES = "pdbr", "tests", "noxfile.py"
@nox.session
def lint(session, reuse_venv=True):
session.install("autoflake", "isort==5.*", "black>=20.8b1")
session.run("autoflake", "--in-place", "--recursive", *SOURCE_FILES)
session.run("black", *SOURCE_FILES)
session.run("isort", *SOURCE_FILES)
@nox.session
def check(session, reuse_venv=True):
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files")
@nox.session(python=["3.7", "3.8", "3.9", "3.10"])
def test(session, reuse_venv=True):
session.install(
"pytest", "pytest-cov", "rich", "icecream", "prompt_toolkit", "sqlparse"
)
session.run("pytest", "--cov-report", "term-missing", "--cov=pdbr", "tests")
@nox.session
@nox.parametrize("django", ["1.8", "1.11", "2.0", "2.2", "3.0"])
def django_test(session, django, reuse_venv=True):
session.install(f"django=={django}", "rich", "pytest", "sqlparse")
session.run("python", "runtests.py")