forked from ValkyrieSystems/sarkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
107 lines (88 loc) · 2.24 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import os
import pathlib
import nox
os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"})
nox.options.sessions = (
"lint",
"data",
"test",
)
@nox.session
def docs(session):
session.run_install(
"pdm", "install", "--frozen-lockfile", "-G", "doc", external=True
)
session.run(
"sphinx-build",
"docs/source",
"docs/build",
"--fail-on-warning",
"--keep-going",
"--fresh-env",
"--write-all",
*session.posargs,
)
@nox.session
def format(session):
session.run_install(
"pdm", "install", "--frozen-lockfile", "-G", "dev-lint", external=True
)
session.run("ruff", "check", "--fix")
session.run("ruff", "format")
@nox.session
def lint(session):
session.run_install(
"pdm", "install", "--frozen-lockfile", "-G", "dev-lint", external=True
)
session.run("ruff", "check")
session.run(
"ruff",
"format",
"--diff",
)
session.run("mypy", pathlib.Path(__file__).parent / "sarkit")
@nox.session
def test(session):
for next_session in ("test_standards", "test_processing", "test_verification"):
session.notify(next_session)
@nox.session
def test_standards(session):
session.run_install(
"pdm", "install", "--frozen-lockfile", "-G", "dev-test", external=True
)
session.run("pytest", "tests/standards")
@nox.session
def test_processing(session):
session.run_install(
"pdm",
"install",
"--frozen-lockfile",
"-G",
"dev-test",
"-G",
"processing",
external=True,
)
session.run("pytest", "tests/processing")
@nox.session
def test_verification(session):
session.run_install(
"pdm",
"install",
"--frozen-lockfile",
"-G",
"dev-test",
"-G",
"verification",
external=True,
)
session.run("pytest", "tests/verification")
@nox.session
def data(session):
session.run_install("pdm", "install", "--frozen-lockfile", external=True)
session.run(
"python", "data/syntax_only/sicd/make_syntax_only_sicd_xmls.py", "--check"
)
session.run(
"python", "data/syntax_only/cphd/make_syntax_only_cphd_xmls.py", "--check"
)