forked from asciipip/greenbutton-python
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
noxfile.py
35 lines (27 loc) · 858 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
"""Nox sessions."""
import nox
package = "greenbutton_objects"
python_versions = ["3.12", "3.11", "3.10", "3.9"]
nox.needs_version = ">= 2024.4.15"
nox.options.sessions = (
"safety",
"mypy",
"tests",
)
@nox.session(python=python_versions[0])
def safety(session) -> None:
"""Scan dependencies for insecure packages."""
session.install(".[dev]")
session.install("safety")
session.run("safety", "check", "--full-report")
@nox.session(python=python_versions)
def mypy(session) -> None:
"""Type-check using mypy."""
args = session.posargs or ["src"]
session.install(".[dev]")
session.run("mypy", *args)
@nox.session(python=python_versions)
def tests(session) -> None:
"""Run the test suite."""
session.install(".[dev]")
session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs)