Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ jobs:
- name: Build the JupyterLite site
run: |
cp README.md content
cd tskit-launcher
jlpm install
jlpm run build
pip install .
cd ..
jupyter lite build --contents content --output-dir dist
9 changes: 6 additions & 3 deletions repl/jupyter-lite.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
"jupyter-lite-schema-version": 0,
"jupyter-config-data": {
"disabledExtensions": [
"@jupyterlab/drawio-extension",
"jupyterlab-kernel-spy",
"jupyterlab-tour"
// "@jupyterlab/drawio-extension",
// "jupyterlab-kernel-spy",
"@jupyterlab/launcher",
"@jupyterlab/launcher-extension",
"@jupyterlab/launcher-extension:plugin"
"@jupyterlab/application-extension:logo"
]
}
}
Expand Down
9 changes: 9 additions & 0 deletions repl/jupyter_lite_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"LiteBuildConfig": {
"contents": ["content"],
"output_dir": "dist"
},
"FederatedExtensionAddon": {
"enabled_extensions": ["tskit_custom_jupyter_launcher"]
}
}
18 changes: 1 addition & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@ notebook~=7.4.3
# Python kernel (optional)
jupyterlite-pyodide-kernel==0.6.1

# JavaScript kernel (optional)
jupyterlite-javascript-kernel==0.3.0

# Language support (optional)
jupyterlab-language-pack-fr-FR
jupyterlab-language-pack-zh-CN

# P5 kernel (optional)
jupyterlite-p5-kernel==0.1.0

# JupyterLab: Fasta file renderer (optional)
jupyterlab-fasta>=3.3.0,<4
# JupyterLab: Geojson file renderer (optional)
jupyterlab-geojson>=3.4.0,<4
# JupyterLab: guided tour (optional)
# TODO: re-enable after https://github.com/jupyterlab-contrib/jupyterlab-tour/issues/82
# jupyterlab-tour
jupyterlab-tour
# JupyterLab: dark theme
jupyterlab-night
# JupyterLab: Miami nights theme (optional)
Expand All @@ -37,9 +27,3 @@ ipyevents>=2.0.1
ipympl>=0.8.2
# Python: ipycanvas library for Jupyter notebooks (optional)
ipycanvas>=0.9.1
# Python: ipyleaflet library for Jupyter notebooks (optional)
ipyleaflet

# Python: plotting libraries (optional)
plotly>=6,<7
bqplot
121 changes: 121 additions & 0 deletions tskit-launcher/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
*.bundle.*
lib/
node_modules/
*.log
.eslintcache
.stylelintcache
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo
tskit_launcher/labextension
# Version file is handled by hatchling
tskit_launcher/_version.py

# 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/
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/

# End of https://www.gitignore.io/api/python

# OSX files
.DS_Store

# Yarn cache
.yarn/
6 changes: 6 additions & 0 deletions tskit-launcher/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
**/node_modules
**/lib
**/package.json
!/package.json
tskit_launcher
1 change: 1 addition & 0 deletions tskit-launcher/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
77 changes: 77 additions & 0 deletions tskit-launcher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# tskit_launcher

[![Github Actions Status](n/a/workflows/Build/badge.svg)](n/a/actions/workflows/build.yml)

Tskit custom launcher

## Requirements

- JupyterLab >= 4.0.0

## Install

To install the extension, execute:

```bash
pip install tskit_launcher
```

## Uninstall

To remove the extension, execute:

```bash
pip uninstall tskit_launcher
```

## Contributing

### Development install

Note: You will need NodeJS to build the extension package.

The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

```bash
# Clone the repo to your local environment
# Change directory to the tskit_launcher directory
# Install package in development mode
pip install -e "."
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build
```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab
```

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

```bash
jupyter lab build --minimize=False
```

### Development uninstall

```bash
pip uninstall tskit_launcher
```

In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
folder is located. Then you can remove the symlink named `tskit_launcher` within that folder.

### Packaging the extension

See [RELEASE](RELEASE.md)
5 changes: 5 additions & 0 deletions tskit-launcher/install.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"packageManager": "python",
"packageName": "tskit_launcher",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package tskit_launcher"
}
Loading