-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
40 lines (34 loc) · 936 Bytes
/
noxfile.py
File metadata and controls
40 lines (34 loc) · 936 Bytes
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
from dotenv import load_dotenv
@nox.session
def format(session: nox.Session) -> None:
session.install("ufmt", "black", "isort")
session.run("ufmt", "format", "app", "tests")
session.run("black", "--config=configs/.black.toml", "app", "tests")
session.run(
"isort",
"--sp=configs/.isort.cfg",
"app",
"tests"
)
@nox.session
def lint(session: nox.Session) -> None:
session.install("ruff", "flake8", "mypy")
session.run(
"ruff",
"check",
"--config=configs/.ruff.toml",
"--fix",
"app",
)
session.run("flake8", "--config=configs/.flake8", "app")
session.run(
"mypy",
"--config-file=configs/.mypy.ini",
"app"
)
@nox.session
def run_tests(session: nox.Session) -> None:
load_dotenv(dotenv_path="./.env.example")
session.install("-r", "requirements.txt")
session.run("pytest")