-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
70 lines (60 loc) · 1.59 KB
/
Copy pathnoxfile.py
File metadata and controls
70 lines (60 loc) · 1.59 KB
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
"""
Noxfile
"""
import nox
nox.options.sessions = ['tests', 'typecheck']
@nox.session()
def clean(session):
session.install('coverage[toml]')
session.run('coverage', 'erase')
@nox.session(venv_backend='uv', python=['3.11', '3.12', '3.13'])
def tests(session):
# session.install('.[dev]')
session.run_install(
'uv',
'sync',
'--extra=dev',
'--frozen',
env={'UV_PROJECT_ENVIRONMENT': session.virtualenv.location},
)
session.run(
'pytest',
'--cov',
'nitrix',
'--cov-append',
)
session.run('ruff', 'check', 'src/nitrix')
session.run('ruff', 'format', '--check', 'src/nitrix')
@nox.session(venv_backend='uv', python=['3.11', '3.12', '3.13'])
def typecheck(session):
# Static-typing gate: every def is annotated (see [tool.mypy] in
# pyproject.toml) and mypy runs in CI so the contract is enforced rather
# than aspirational. Kept separate from ``tests`` so a type regression is
# legible on its own.
session.run_install(
'uv',
'sync',
'--extra=dev',
'--frozen',
env={'UV_PROJECT_ENVIRONMENT': session.virtualenv.location},
)
session.run('mypy', 'src/nitrix')
@nox.session()
def report(session):
session.install('coverage[toml]')
session.run(
'coverage',
'report',
'--fail-under=99',
"--omit='*test*,*__init__*'",
)
session.run(
'coverage',
'html',
"--omit='*test*,*__init__*'",
)
session.run(
'coverage',
'xml',
"--omit='*test*,*__init__*'",
)