-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathnoxfile.py
More file actions
35 lines (24 loc) · 826 Bytes
/
noxfile.py
File metadata and controls
35 lines (24 loc) · 826 Bytes
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
# SPDX-License-Identifier: MIT
import os
import os.path
import nox
nox.options.default_venv_backend = 'uv|virtualenv'
nox.options.sessions = ['mypy', 'test']
nox.options.reuse_existing_virtualenvs = True
@nox.session(python='3.8')
def mypy(session):
session.install('.', 'mypy')
session.run('mypy', '-p', 'hid_parser')
@nox.session(python=['3.9', '3.10', '3.11', '3.12', '3.13'])
def test(session):
htmlcov_output = os.path.join(session.virtualenv.location, 'htmlcov')
xmlcov_output = os.path.join(session.virtualenv.location, f'coverage-{session.python}.xml')
session.install('.', '--group', 'test')
session.run(
'pytest',
'--cov',
f'--cov-report=html:{htmlcov_output}',
f'--cov-report=xml:{xmlcov_output}',
'tests/',
*session.posargs,
)