-
-
Notifications
You must be signed in to change notification settings - Fork 56
/
noxfile.py
49 lines (37 loc) · 1.01 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
import nox
nox.options.sessions = ["tests", "lint"]
@nox.session
def tests(session: nox.Session) -> None:
"""
Run the unit and regular tests.
"""
session.install("-e.[dev]")
session.run("pytest")
@nox.session
def lint(session: nox.Session) -> None:
"""
Run lint with ruff.
"""
session.install("-e.[dev]")
session.run("ruff", "check", "brazilcep")
@nox.session
def coverage(session: nox.Session) -> None:
"""
Run coverage.
"""
session.install("-e.[coverage]")
session.run("pytest", "--cov", "brazilcep")
@nox.session
def check_manifest(session: nox.Session) -> None:
"""
Ensure all needed files are included in the manifest.
"""
session.install("check-manifest")
session.run("check-manifest", *session.posargs)
@nox.session
def docs(session: nox.Session) -> None:
"""
Build the docs. Will serve unless --non-interactive
"""
session.install("-e.[docs]")
session.run("mkdocs", "serve" if session.interactive else "build")