-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnoxfile.py
More file actions
53 lines (43 loc) · 1.66 KB
/
noxfile.py
File metadata and controls
53 lines (43 loc) · 1.66 KB
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
import nox
from shlex import split
from os.path import realpath
nox.options.reuse_existing_virtualenvs = True
nox.options.default_venv_backend = "uv"
@nox.session(name="docs-live")
def docs_live(session):
for ii in ["requirements.txt"]:
session.run("uv", "pip", "install", "-U", "-r", ii, silent=True)
session.chdir("book")
session.run(*"myst start --execute".split(),*session.posargs)
@nox.session
def docs(session):
for ii in ["requirements.txt"]:
session.run("uv", "pip", "install", "-U", "-r", ii, silent=True)
session.chdir("book")
session.run(*"myst build --html --execute".split(),*session.posargs)
@nox.session
def lab(session):
for ii in ["requirements.txt"]:
session.run("uv", "pip", "install", "-U", "-r", ii, silent=True)
session.run(*split("jupyter lab ."))
@nox.session(name="download")
def download(session):
"""Download GitHub data for Jupyter organizations.
Usage:
nox -s download # Download all orgs
nox -s download -- jupyter-book # Download specific org
"""
session.run("uv", "pip", "install", "-U", "-r", "requirements.txt", silent=True)
# Default organizations to download
orgs = ["jupyter", "jupyterlab", "jupyter-book", "jupyter-server", "jupyterhub"]
# Allow override from command line
if session.posargs:
orgs = session.posargs
print(f"\n{'='*60}")
print(f"Downloading data for organizations: {', '.join(orgs)}")
print(f"{'='*60}\n")
for org in orgs:
print(f"\n{'='*60}")
print(f"Processing organization: {org}")
print(f"{'='*60}\n")
session.run("python", "scripts/download_issues.py", org)