generated from 12rambau/pypackage
-
Notifications
You must be signed in to change notification settings - Fork 2
/
noxfile.py
39 lines (29 loc) · 1.18 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
"""All the process that can be run using nox.
The nox run are build in isolated environment that will be stored in .nox. to force the venv update, remove the .nox/xxx folder.
"""
from pathlib import Path
import nox
@nox.session(reuse_venv=True)
def docs(session):
"""Build the documentation."""
session.install(".[doc]")
b = session.posargs[0] if session.posargs else "html"
dst = Path(__file__).parent / "docs" / "_build" / b
session.run("sphinx-build", f"-b={b}", "-a", "-E", "docs", str(dst))
@nox.session(reuse_venv=True)
def lint(session):
"""Apply the pre-commits."""
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files")
@nox.session(reuse_venv=True)
def mypy(session):
"""Run a mypy check of the lib."""
session.install("mypy")
test_files = session.posargs or ["sphinxcontrib"]
session.run("mypy", *test_files)
@nox.session(reuse_venv=True)
def test(session):
"""Run all the test using the environment varialbe of the running machine."""
session.install("--verbose", ".[test]")
# session.run("pytest", "--color=yes", "--cov", "--cov-report=html", *test_files)
session.run("sphinx-build", "--bug-report")