generated from njzjz/python-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
noxfile.py
34 lines (30 loc) · 803 Bytes
/
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
"""Nox configuration file."""
from __future__ import annotations
import nox
@nox.session
def tests(session: nox.Session) -> None:
"""Run test suite with pytest."""
session.install(
"numpy",
"deepmd-kit[torch]>=3.0.0b2",
"--extra-index-url",
"https://download.pytorch.org/whl/cpu",
)
cmake_prefix_path = session.run(
"python",
"-c",
"import torch;print(torch.utils.cmake_prefix_path)",
silent=True,
).strip()
session.log(f"{cmake_prefix_path=}")
session.install("-e.[test]", env={"CMAKE_PREFIX_PATH": cmake_prefix_path})
session.run(
"pytest",
"--cov",
"--cov-config",
"pyproject.toml",
"--cov-report",
"term",
"--cov-report",
"xml",
)