-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnoxfile.py
32 lines (25 loc) · 887 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
# noxfile.py
import nox
locations = "specufex", "tests", "noxfile.py"
nox.options.sessions = "lint", "tests"
@nox.session(python=["3.10", "3.9", "3.8"], venv_backend="mamba")
def tests(session):
session.run("mamba", "install", "-y", "--file", "requirements.txt")
session.run("pip", "install", "-r", "requirements-dev.txt")
session.install("-e", ".", "--no-deps")
session.run("pytest", "--cov")
@nox.session(python=["3.10", "3.9", "3.8"], venv_backend="mamba")
def lint(session):
args = session.posargs or locations
session.install(
"flake8",
"flake8-black",
"flake8-isort",
"flake8-pyprojecttoml",
)
session.run("flake8", *args)
@nox.session(python=["3.10", "3.9", "3.8"], venv_backend="mamba")
def black(session):
args = session.posargs or locations
session.install("black")
session.run("black", *args)