Skip to content

Commit c1510d4

Browse files
authored
Merge pull request #3491 from jasongrout/jlite2
Package example notebooks in JupyterLite
2 parents 7c7912f + 5a40069 commit c1510d4

39 files changed

+628
-395
lines changed

.github/workflows/tests.yml

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: Set up Python
12-
uses: actions/setup-python@v1
12+
uses: actions/setup-python@v4
1313
with:
1414
python-version: 3.7
15-
- uses: actions/cache@v1
15+
cache: 'pip'
16+
cache-dependency-path: |
17+
**/setup.cfg
18+
**/requirements*.txt
19+
- name: Install node
20+
uses: actions/setup-node@v3
1621
with:
17-
path: ~/.cache/pip
18-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
19-
restore-keys: |
20-
${{ runner.os }}-pip-
22+
node-version: '14'
23+
cache: 'yarn'
24+
cache-dependency-path: |
25+
yarn.lock
26+
ui-tests/yarn.lock
2127
- name: Install dependencies
2228
run: |
2329
sudo apt-get install -y pandoc
@@ -26,24 +32,22 @@ jobs:
2632
python -m pip install -r ./docs/requirements.txt
2733
- name: Build docs
2834
run: |
29-
cd docs
30-
make html
35+
cd docs/source
36+
python -m sphinx -T -E -b html -d ../build/doctrees -D language=en . ../build/html
3137
js:
3238
name: JavaScript
3339
runs-on: ubuntu-latest
3440

3541
steps:
3642
- uses: actions/checkout@v2
3743
- name: Set up Python
38-
uses: actions/setup-python@v1
44+
uses: actions/setup-python@v4
3945
with:
4046
python-version: 3.7
41-
- uses: actions/cache@v1
42-
with:
43-
path: ~/.cache/pip
44-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
45-
restore-keys: |
46-
${{ runner.os }}-pip-
47+
cache: 'pip'
48+
cache-dependency-path: |
49+
**/setup.cfg
50+
**/requirements*.txt
4751
- name: Install dependencies
4852
run: |
4953
sudo apt-get install -y firefox
@@ -93,15 +97,13 @@ jobs:
9397
steps:
9498
- uses: actions/checkout@v2
9599
- name: Set up Python ${{ matrix.python-version }}
96-
uses: actions/setup-python@v2
100+
uses: actions/setup-python@v4
97101
with:
98102
python-version: ${{ matrix.python-version }}
99-
- uses: actions/cache@v1
100-
with:
101-
path: ~/.cache/pip
102-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
103-
restore-keys: |
104-
${{ runner.os }}-pip-
103+
cache: 'pip'
104+
cache-dependency-path: |
105+
**/setup.cfg
106+
**/requirements*.txt
105107
- name: Install dependencies
106108
run: |
107109
python -m pip install --upgrade pip
@@ -117,15 +119,13 @@ jobs:
117119
steps:
118120
- uses: actions/checkout@v2
119121
- name: Set up Python
120-
uses: actions/setup-python@v1
122+
uses: actions/setup-python@v4
121123
with:
122124
python-version: 3.7
123-
- uses: actions/cache@v1
124-
with:
125-
path: ~/.cache/pip
126-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
127-
restore-keys: |
128-
${{ runner.os }}-pip-
125+
cache: 'pip'
126+
cache-dependency-path: |
127+
**/setup.cfg
128+
**/requirements*.txt
129129
- name: Install dependencies
130130
run: |
131131
python -m pip install --upgrade pip
@@ -141,16 +141,13 @@ jobs:
141141
steps:
142142
- uses: actions/checkout@v2
143143
- name: Set up Python
144-
uses: actions/setup-python@v2
144+
uses: actions/setup-python@v4
145145
with:
146146
python-version: '3.10'
147-
- uses: actions/cache@v1
148-
with:
149-
path: ~/.cache/pip
150-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
151-
restore-keys: |
152-
${{ runner.os }}-pip-
153-
147+
cache: 'pip'
148+
cache-dependency-path: |
149+
**/setup.cfg
150+
**/requirements*.txt
154151
- name: Install dependencies
155152
run: |
156153
python -m pip install --upgrade pip

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ dist
44
_build
55
docs/man/*.gz
66
docs/source/api/generated
7+
docs/source/.cache
8+
*.doit.db
9+
_contents
710
node_modules
811
*.py[co]
912
__pycache__

.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "mambaforge-4.10"
7+
python:
8+
install:
9+
- method: pip
10+
path: ./python/ipywidgets
11+
conda:
12+
environment: docs/environment.yml
13+
14+
# python:
15+
# version: 3.7
16+
# install:
17+
# - method: pip
18+
# path: ./python/ipywidgets
19+
# - requirements: docs/requirements.txt

docs/Makefile

Lines changed: 0 additions & 36 deletions
This file was deleted.

docs/Readme.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Building ipywidgets documentation
2+
3+
To build the ipywidgets documentation:
4+
5+
1. Install the development version of ipywidgets with the `dev-install.sh` script in the repo root directory.
6+
2. Install the Python packages for building documentation with either mamba or conda:
7+
```sh
8+
conda update --file docs/environment.yml
9+
```
10+
11+
or with `pip`:
12+
13+
```sh
14+
python -m pip install -r docs/requirements.txt
15+
# Also install pandoc separately
16+
```
17+
18+
3. Build the HTML docs with sphinx:
19+
```sh
20+
cd docs/source
21+
python -m sphinx -T -E -b html -d ../build/doctrees -D language=en . ../build/html
22+
```
23+
24+
4. Open the documentation from the build directory: `docs/build/html`

docs/environment.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: docs
2+
channels:
3+
- conda-forge
4+
- nodefaults
5+
dependencies:
6+
- bqplot
7+
- build
8+
- empack
9+
- ipykernel
10+
- jupyter_client
11+
- jupyterlab >=3,<4
12+
- jupyter-packaging
13+
- matplotlib
14+
- nbsphinx
15+
- nodejs=14
16+
- numpy
17+
- packaging
18+
- pandoc
19+
- pip
20+
- python=3.10
21+
- recommonmark
22+
- scikit-image
23+
- scikit-learn
24+
- sphinx
25+
- sphinx_rtd_theme
26+
- sympy
27+
- pip:
28+
- jupyterlite==0.1.0b10
29+
- jupyterlite-sphinx>=0.6.0

docs/make.bat

Lines changed: 0 additions & 65 deletions
This file was deleted.

docs/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
bqplot
2+
build
23
ipykernel
34
jupyter_client
5+
jupyterlab>=3,<4
6+
jupyterlite-sphinx
47
matplotlib
58
nbsphinx>=0.5
69
numpy
@@ -10,3 +13,6 @@ sphinx_rtd_theme
1013
packaging
1114
scikit-image
1215
scikit-learn
16+
sympy
17+
jupyterlite==0.1.0b10
18+
jupyterlite-sphinx>=0.6.0

0 commit comments

Comments
 (0)