forked from HinodeXRT/xrtpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
69 lines (53 loc) · 1.48 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
57
58
59
60
61
62
63
64
65
66
67
68
69
import nox
nox.options.sessions = ["tests", "linters"]
python_versions = ("3.10", "3.11", "3.12")
sphinx_paths = ["docs", "docs/_build/html"]
sphinx_fail_on_warnings = ["-W", "--keep-going"]
sphinx_builder = ["-b", "html"]
sphinx_opts = sphinx_paths + sphinx_fail_on_warnings + sphinx_builder
sphinx_no_notebooks = ["-D", "nbsphinx_execute=never"]
sphinx_nitpicky = ["-n"]
pytest_options = [
"--ignore",
"xrtpy/response/effective_area.py",
"--ignore",
"xrtpy/response/temperature_response.py",
]
@nox.session(python=python_versions)
def tests(session):
session.install(".[dev,tests]")
session.run("pytest", *pytest_options)
@nox.session
def linters(session):
session.install("pre-commit")
session.run("pre-commit", "run", "--all-files", *session.posargs)
@nox.session
def import_package(session):
session.install(".")
session.run("python", "-c", 'import xrtpy') # fmt: skip
@nox.session
def build_docs(session):
session.install(".[dev,docs]")
session.run(
"sphinx-build",
*sphinx_opts,
*session.posargs,
)
@nox.session
def build_docs_nitpicky(session):
session.install(".[dev,docs]")
session.run(
"sphinx-build",
*sphinx_opts,
*sphinx_nitpicky,
*session.posargs,
)
@nox.session
def build_docs_no_examples(session):
session.install(".[dev,docs]")
session.run(
"sphinx-build",
*sphinx_opts,
*sphinx_no_notebooks,
*session.posargs,
)