/
noxfile.py
49 lines (43 loc) · 1.11 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
import nox
from pathlib import Path
nox.needs_version = ">=2022.1.7"
DIR = Path(__file__).parent.resolve()
@nox.session(reuse_venv=True)
def pyodide(session: nox.Session) -> None:
session.install("jupyterlite[lab]")
session.run("jupyter", "lite", "init")
session.run("jupyter", "lite", "build", "--contents=content")
if "--serve" in session.posargs:
session.run("jupyter", "lite", "serve")
@nox.session(reuse_venv=True)
def book(session: nox.Session) -> None:
session.install(
"black",
"cattrs",
"cffi",
"ipykernel",
"ipython",
"ipywidgets",
"jupyter-book",
"matplotlib",
"numba",
"numpy",
"pandas",
"pybind11",
"pytest",
"rich",
"scikit-build-core",
"sphinxcontrib-mermaid",
)
env = {"PYDEVD_DISABLE_FILE_VALIDATION": "1"}
session.run(
"python",
"-m",
"ipykernel",
"install",
"--user",
"--name",
"conda-env-se-for-sci-py",
env=env,
)
session.run("jupyter-book", "build", ".", env=env)