Skip to content

Commit

Permalink
Merge pull request #3491 from jasongrout/jlite2
Browse files Browse the repository at this point in the history
Package example notebooks in JupyterLite
  • Loading branch information
ibdafna authored Jul 11, 2022
2 parents 7c7912f + 5a40069 commit c1510d4
Show file tree
Hide file tree
Showing 39 changed files with 628 additions and 395 deletions.
71 changes: 34 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
- uses: actions/cache@v1
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install node
uses: actions/setup-node@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
node-version: '14'
cache: 'yarn'
cache-dependency-path: |
yarn.lock
ui-tests/yarn.lock
- name: Install dependencies
run: |
sudo apt-get install -y pandoc
Expand All @@ -26,24 +32,22 @@ jobs:
python -m pip install -r ./docs/requirements.txt
- name: Build docs
run: |
cd docs
make html
cd docs/source
python -m sphinx -T -E -b html -d ../build/doctrees -D language=en . ../build/html
js:
name: JavaScript
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install dependencies
run: |
sudo apt-get install -y firefox
Expand Down Expand Up @@ -93,15 +97,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -117,15 +119,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -141,16 +141,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{hashFiles('**/requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ dist
_build
docs/man/*.gz
docs/source/api/generated
docs/source/.cache
*.doit.db
_contents
node_modules
*.py[co]
__pycache__
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-4.10"
python:
install:
- method: pip
path: ./python/ipywidgets
conda:
environment: docs/environment.yml

# python:
# version: 3.7
# install:
# - method: pip
# path: ./python/ipywidgets
# - requirements: docs/requirements.txt
36 changes: 0 additions & 36 deletions docs/Makefile

This file was deleted.

24 changes: 24 additions & 0 deletions docs/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Building ipywidgets documentation

To build the ipywidgets documentation:

1. Install the development version of ipywidgets with the `dev-install.sh` script in the repo root directory.
2. Install the Python packages for building documentation with either mamba or conda:
```sh
conda update --file docs/environment.yml
```

or with `pip`:

```sh
python -m pip install -r docs/requirements.txt
# Also install pandoc separately
```

3. Build the HTML docs with sphinx:
```sh
cd docs/source
python -m sphinx -T -E -b html -d ../build/doctrees -D language=en . ../build/html
```

4. Open the documentation from the build directory: `docs/build/html`
29 changes: 29 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: docs
channels:
- conda-forge
- nodefaults
dependencies:
- bqplot
- build
- empack
- ipykernel
- jupyter_client
- jupyterlab >=3,<4
- jupyter-packaging
- matplotlib
- nbsphinx
- nodejs=14
- numpy
- packaging
- pandoc
- pip
- python=3.10
- recommonmark
- scikit-image
- scikit-learn
- sphinx
- sphinx_rtd_theme
- sympy
- pip:
- jupyterlite==0.1.0b10
- jupyterlite-sphinx>=0.6.0
65 changes: 0 additions & 65 deletions docs/make.bat

This file was deleted.

6 changes: 6 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
bqplot
build
ipykernel
jupyter_client
jupyterlab>=3,<4
jupyterlite-sphinx
matplotlib
nbsphinx>=0.5
numpy
Expand All @@ -10,3 +13,6 @@ sphinx_rtd_theme
packaging
scikit-image
scikit-learn
sympy
jupyterlite==0.1.0b10
jupyterlite-sphinx>=0.6.0
Loading

0 comments on commit c1510d4

Please sign in to comment.