-
Notifications
You must be signed in to change notification settings - Fork 4
/
noxfile.py
56 lines (44 loc) · 1.31 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""Nox session configuration."""
from typing import List
import nox
from nox.sessions import Session
PACKAGE: str = "pyprql"
LOCATIONS: List[str] = [
PACKAGE,
"noxfile.py",
]
VERSIONS: List[str] = [
"3.8",
"3.9",
"3.10",
]
nox.options.stop_on_first_error = False
nox.options.reuse_existing_virtualenvs = True
@nox.session(python=VERSIONS)
def type(session: Session) -> None:
"""Type check files with mypy."""
session.run_always("poetry", "install", external=True)
args = session.posargs or LOCATIONS
session.run("mypy", "--show-error-codes", *args)
@nox.session(python="3.10")
def security(session: Session) -> None:
"""Check security safety."""
session.run_always("poetry", "install", external=True)
session.run(
"safety",
"check",
"--ignore=51668",
"--ignore=51457",
"--full-report",
)
@nox.session(python=VERSIONS)
def tests(session: Session) -> None:
"""Run the test suite with pytest."""
session.run_always("poetry", "install", external=True)
args = session.posargs or []
session.run("pytest", *args)
@nox.session(python="3.10")
def docs(session: Session) -> None:
"""Build the documentation."""
session.run_always("poetry", "install", external=True)
session.run("sphinx-build", "docs", "docs/_build")