A labextension to integrate pyflyby with notebooks
Pyflyby helps you get rid of the tedious task of recalling and adding import statements. This labextension takes it further by adding the import statements automatically in your notebook. For eg. executing np.arange(10)
You can decide cell where imports should be added by adding 'pyflyby-cell' cell tag to it.
- JupyterLab >= 4.0
pip install jupyterlab_pyflybyNote: You will need NodeJS to build the extension package.
The jlpm command is the pinned version of yarn that is
installed with jupyter-builder.
You may use yarn or npm in lieu of jlpm below.
# Clone the repo to your local environment
# Change directory to the jupyterlab_pyflyby directory
# Install package in development mode, along with the development dependencies
pip install -e ".[dev]"
# Link your development version of the extension with JupyterLab
jupyter-builder develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run buildYou 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.
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter-labWith 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 run 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:
jupyter lab build --minimize=FalseEvery verb method of every handler in jupyterlab_pyflyby/handlers.py must carry a
@tornado.web.authenticated decorator, or, if an endpoint is deliberately public, an
explicit @allow_unauthenticated/@ws_authenticated decorator from
jupyter_server.auth.decorator. The build workflow enforces this by running:
python .github/scripts/check_auth.py- Install dependencies:
pip install twine hatch - Update the version in
package.jsonand update the release date inCHANGELOG.md - Commit the change in step 1
- For test release, manually trigger the
Build and publish to PyPIworkflow - you need to check theTest releasecheckbox - Draft a new GitHub release, creating an approriate version tag
- Publish the draft and verify that the
publishjob in the build workflow passed.
pip uninstall jupyterlab_pyflybyThis plugin was contributed back to the community by the D. E. Shaw group.
This project is released under a BSD-3-Clause license.
We love contributions! Before you can contribute, please sign and submit this Contributor License Agreement (CLA). This CLA is in place to protect all users of this project.
"Jupyter" is a trademark of the LF Charities, of which Project Jupyter is a part.
