-
Notifications
You must be signed in to change notification settings - Fork 6
/
noxfile.py
40 lines (29 loc) · 876 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
import nox
nox.options.sessions = ["format", "lint", "mypy", "test"]
@nox.session
def format(session: nox.Session):
session.install("black", "isort")
session.run("isort", ".")
session.run("black", ".")
@nox.session
def check_format(session: nox.Session):
session.install("black", "isort")
session.run("isort", ".", "--check")
session.run("black", ".", "--check")
@nox.session
def lint(session: nox.Session):
session.install("ruff")
session.run("ruff", "check", ".")
@nox.session
def mypy(session: nox.Session) -> None:
session.install(".[stream,test]", "mypy")
session.run("mypy")
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
def test(session: nox.Session):
session.install("-e", ".[stream,test]")
session.run(
"pytest",
"--cov",
"--cov-report=xml",
"--cov-report=term",
)