forked from exoplanet-dev/jaxoplanet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
59 lines (49 loc) · 1.3 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
# mypy: ignore-errors
import nox
ALL_PYTHON_VS = ["3.10", "3.11", "3.12"]
@nox.session(python=ALL_PYTHON_VS)
def test(session):
session.install(".[test,test-math]")
session.run("pytest", "-n", "auto", *session.posargs)
@nox.session(python=ALL_PYTHON_VS)
def test_x64(session):
session.install(".[test,test-math]")
env = {"JAX_ENABLE_X64": "1"}
session.run("pytest", "-n", "auto", *session.posargs, env=env)
@nox.session(python=["3.10"])
def comparison(session):
session.install(".[test,comparison]", "numpy<1.22")
session.run("python", "-c", "import starry")
session.run("python", "-c", "import theano")
if session.posargs:
args = session.posargs
else:
args = ("tests/experimental/starry",)
session.run(
"pytest",
"-n",
"auto",
*args,
env={"JAX_ENABLE_X64": "True"},
)
@nox.session
def docs(session):
session.install(".[docs]")
with session.chdir("docs"):
session.run(
"python",
"-m",
"sphinx",
"-T",
"-E",
"-W",
"--keep-going",
"-b",
"dirhtml",
"-d",
"_build/doctrees",
"-D",
"language=en",
".",
"_build/dirhtml",
)