-
Notifications
You must be signed in to change notification settings - Fork 22
JupyterLite support #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| name: build-env | ||
| channels: | ||
| - conda-forge | ||
| dependencies: | ||
| - python | ||
| - pip | ||
| - jupyter_server | ||
| - jupyterlite-core >=0.7 | ||
| - jupyterlite-xeus >=4.3 | ||
| - notebook >=7.5 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,56 @@ | ||||||
| name: Build and Deploy | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: | ||||||
| - main | ||||||
| pull_request: | ||||||
| branches: | ||||||
| - '*' | ||||||
|
|
||||||
| jobs: | ||||||
| build: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Setup Python | ||||||
| uses: actions/setup-python@v5 | ||||||
| with: | ||||||
| python-version: '3.12' | ||||||
|
|
||||||
| - name: Install mamba | ||||||
| uses: mamba-org/setup-micromamba@v1 | ||||||
| with: | ||||||
| micromamba-version: '1.5.8-0' | ||||||
| environment-file: .github/build-environment.yml | ||||||
| cache-environment: true | ||||||
|
|
||||||
| - name: Build the JupyterLite site | ||||||
| shell: bash -l {0} | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should keep the error check
Suggested change
|
||||||
| run: | | ||||||
| cp README.md content | ||||||
| jupyter lite build --contents content --output-dir dist | ||||||
|
|
||||||
| - name: Upload artifact | ||||||
| uses: actions/upload-pages-artifact@v3 | ||||||
| with: | ||||||
| path: ./dist | ||||||
|
|
||||||
| deploy: | ||||||
| needs: build | ||||||
| if: github.ref == 'refs/heads/main' | ||||||
| permissions: | ||||||
| pages: write | ||||||
| id-token: write | ||||||
|
|
||||||
| environment: | ||||||
| name: github-pages | ||||||
| url: ${{ steps.deployment.outputs.page_url }} | ||||||
|
|
||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Deploy to GitHub Pages | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use GitHub Pages, so this deployment is not necessary. You should push the results to the |
||||||
| id: deployment | ||||||
| uses: actions/deploy-pages@v4 | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| *.bundle.* | ||
| lib/ | ||
| node_modules/ | ||
| .yarn-packages/ | ||
| *.egg-info/ | ||
| .ipynb_checkpoints | ||
| *.tsbuildinfo | ||
|
|
||
| # Created by https://www.gitignore.io/api/python | ||
| # Edit at https://www.gitignore.io/?templates=python | ||
|
|
||
| ### Python ### | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| pip-wheel-metadata/ | ||
| share/python-wheels/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
| # PyInstaller | ||
| # Usually these files are written by a python script from a template | ||
| # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
| *.manifest | ||
| *.spec | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
|
|
||
| # Translations | ||
| *.mo | ||
| *.pot | ||
|
|
||
| # Scrapy stuff: | ||
| .scrapy | ||
|
|
||
| # Sphinx documentation | ||
| docs/_build/ | ||
|
|
||
| # PyBuilder | ||
| target/ | ||
|
|
||
| # pyenv | ||
| .python-version | ||
|
|
||
| # celery beat schedule file | ||
| celerybeat-schedule | ||
|
|
||
| # SageMath parsed files | ||
| *.sage.py | ||
|
|
||
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
|
|
||
| # Rope project settings | ||
| .ropeproject | ||
|
|
||
| # Mr Developer | ||
| .mr.developer.cfg | ||
| .project | ||
| .pydevproject | ||
|
|
||
| # mkdocs documentation | ||
| /site | ||
|
|
||
| # mypy | ||
| .mypy_cache/ | ||
| .dmypy.json | ||
| dmypy.json | ||
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
|
|
||
| # OS X stuff | ||
| *.DS_Store | ||
|
|
||
| # End of https://www.gitignore.io/api/python | ||
|
|
||
| # jupyterlite | ||
| *.doit.db | ||
| _output | ||
|
|
||
| # virtual environment | ||
| .venv/ |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this added? This branch isn't published on GitHub Pages. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,19 @@ | ||
| # mpl-brochure-binder | ||
|
|
||
| See binder at https://mybinder.org/v2/gh/matplotlib/mpl-brochure-binder/main?labpath=MatplotlibExample.ipynb | ||
| Interactive Matplotlib visualization examples. | ||
|
|
||
| Note that we use jupytext to synchronize with a markdown file; if we edit the markdown file, be sure to run jupyterlab with jupytext enabled to get the actual notebook synchronized before committing. (Note not 100% sure this works across different installs, but lets try it and see). | ||
| ## JupyterLite | ||
|
|
||
| Try it in your browser (no installation required): | ||
|
|
||
| [](https://matplotlib.github.io/mpl-brochure-binder/lab/index.html?path=MatplotlibExample.ipynb) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use GitHub Pages URLs; this link is broken. |
||
|
|
||
| ## Binder | ||
|
|
||
| Launch with Binder: | ||
|
|
||
| [](https://mybinder.org/v2/gh/matplotlib/mpl-brochure-binder/main?labpath=MatplotlibExample.ipynb) | ||
|
|
||
| ## Development | ||
|
|
||
| We use jupytext to synchronize notebooks with markdown files. If editing the markdown file, be sure to run JupyterLab with jupytext enabled to synchronize the notebook before committing. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we still need these files if you've moved them to |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and all other actions) is outdated, and should use SHA hashes instead of rolling tags.