-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
42 lines (33 loc) · 940 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
35
36
37
38
39
40
41
42
import nox
from nox import Session
nox.options.reuse_existing_virtualenvs = True
@nox.session(python=["3.10"])
def install(session: Session) -> None:
groups = ["main", "dev", "docs"]
session.run(
"poetry",
"install",
"--no-root",
"--sync",
f"--only={','.join(groups)}",
external=True,
)
@nox.session(python=["3.10"])
def linting(session: Session) -> None:
session.run("poetry", "run", "mypy")
session.run("poetry", "run", "black", ".")
session.run(
"poetry",
"run",
"ruff",
"check",
"--fix",
"--show-fixes",
"--exit-non-zero-on-fix",
)
@nox.session(python=["3.10"])
def tests(session: Session) -> None:
session.run("poetry", "run", "pytest", "-m", "not simulate")
@nox.session(python=["3.10"])
def simulate(session: Session) -> None:
session.run("poetry", "run", "pytest", "-m", "simulate")