forked from soda-inria/hazardous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
59 lines (49 loc) · 1.59 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
import nox
def _common_test_steps(session):
session.run("python", "-c", "import sklearn; sklearn.show_versions()")
if session.posargs:
session.run("pytest", *session.posargs)
else:
session.run("pytest", "-v", "--cov", "--pyargs", "hazardous")
# TODO: add 3.12 as soon as numpy and scikit-learn upload 3.12 wheels
# built against the pre-releases.
# https://dev.to/hugovk/help-test-python-312-beta-1508
@nox.session(python=["3.9", "3.10", "3.11"])
def test_latest_from_pypi(session):
# Test the newest versions of the dependencies.
session.install(".[test]")
_common_test_steps(session)
@nox.session(python=["3.11"], venv_backend="mamba")
def test_latest_from_conda_forge(session):
# Test the newest versions of the dependencies from conda-forge.
# XXX: hown to do the same with a single mamba install command?
for package_name in [
"pytest",
"pytest-cov",
"numpy",
"pandas",
"scikit-learn",
"lifelines",
"tqdm",
]:
session.conda_install(package_name, channel="conda-forge")
session.install(".")
_common_test_steps(session)
@nox.session(python=["3.9"])
def test_oldest_from_pypi(session):
# Test the oldest supported version of the dependencies.
session.install(".[test,oldest_deps]")
_common_test_steps(session)
@nox.session
def doc(session):
session.install(".[doc]")
session.run(
# fmt: off
"python", "-m", "sphinx",
"-T", "-E",
"-W", "--keep-going",
"-b", "html",
"doc",
"doc/_build/html",
# fmt: on
)