-
Notifications
You must be signed in to change notification settings - Fork 0
docs: update OSS docs #34
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1efc889
Add CONTRIBUTING.md
andyjakubowski e34145a
docs: update README, CONTRIBUTING, RELEASE
andyjakubowski f1210d2
Fix heading
andyjakubowski cce9f56
Update Python version
andyjakubowski fd857e1
Update readme
andyjakubowski a0205eb
Merge branch 'main' into andy/grn-4956-update-oss-docs
andyjakubowski deefc67
Remove conda forge release instructions
andyjakubowski c700cdc
Update required JupyterLab version to 4.5
andyjakubowski ecf7f87
Merge branch 'main' into andy/grn-4956-update-oss-docs
jamesbhobbs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| # Scope | ||
|
|
||
| This document is intended for contributors and maintainers working on the extension's source code. For general usage and installation instructions, please refer to the README. | ||
|
|
||
| # Contributing to `jupyterlab-deepnote` | ||
|
|
||
| ## Development install | ||
|
|
||
| Note: You will need NodeJS to build the extension package. | ||
|
|
||
| Use any Python environment and dependency manager you like, for example [uv](https://docs.astral.sh/uv/getting-started/installation/): | ||
|
|
||
| ```shell | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| ``` | ||
|
|
||
| Create a Python environment in the project directory: | ||
|
|
||
| ```shell | ||
| uv venv --python 3.12 --managed-python | ||
| ``` | ||
|
|
||
| Activate the Python environment: | ||
|
|
||
| ```shell | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| Install `jupyterlab`. The extension package itself doesn’t depend on `jupyterlab`, you just need `jupyterlab` in the environment where you will be testing the extension. | ||
|
|
||
| ```shell | ||
| uv pip install jupyterlab | ||
| ``` | ||
|
|
||
| ### Configure Access to @deepnote/blocks Package | ||
|
|
||
| The `@deepnote/blocks` package is published on GitHub Packages. To install it, you'll need to authenticate with GitHub: | ||
|
|
||
| 1. Create a GitHub Personal Access Token (classic) with `read:packages` scope: | ||
| - Go to https://github.com/settings/tokens | ||
| - Click "Generate new token (classic)" | ||
| - Select the `read:packages` scope | ||
| - Generate and copy the token | ||
|
|
||
| 2. Set the `GITHUB_TOKEN` environment variable to ensure `jlpm` (which is a wrapper around Yarn) can download the `@deepnote/blocks` package from the GitHub package registry. You can export the variable in `.zshrc` (or by reading a `~/.env` file): | ||
| ```shell | ||
| export GITHUB_TOKEN=your_token_here | ||
| ``` | ||
| Replace `YOUR_TOKEN_HERE` with your actual token. | ||
|
|
||
| Install the extension package in editable mode. It installs the package’s dependencies, too: | ||
|
|
||
| ```shell | ||
| uv pip install --editable . --verbose | ||
| ``` | ||
|
|
||
| Link your development version of the extension with JupyterLab: | ||
|
|
||
| ```shell | ||
| jupyter labextension develop . --overwrite | ||
| ``` | ||
|
|
||
| Enable the extension in Jupyter Server: | ||
|
|
||
| ```shell | ||
| jupyter server extension enable jupyterlab_deepnote | ||
| ``` | ||
|
|
||
| Rebuild the extension’s Typescript source after making changes: | ||
|
|
||
| ```shell | ||
| jlpm run watch | ||
| ``` | ||
|
|
||
| The `jlpm` command is JupyterLab's pinned version of | ||
| [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use | ||
| `yarn` or `npm` instead of `jlpm` below. | ||
|
|
||
| In a separate terminal, run `jupyter lab`. You can add the `--debug` option to see HTTP requests in the logs, which can be helpful for debugging. | ||
|
|
||
| ```shell | ||
| jupyter lab --debug | ||
| ``` | ||
|
|
||
| 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 | ||
| # Server extension must be manually disabled in develop mode | ||
| jupyter server extension disable jupyterlab_deepnote | ||
| pip uninstall jupyterlab_deepnote | ||
| ``` | ||
|
|
||
| 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 `jupyterlab-deepnote` within that folder. | ||
|
|
||
| ## Testing the extension | ||
|
|
||
| ### Server tests | ||
|
|
||
| This extension is using [Pytest](https://docs.pytest.org/) for Python code testing. | ||
|
|
||
| Install test dependencies (needed only once): | ||
|
|
||
| ```sh | ||
| pip install -e ".[test]" | ||
| # Each time you install the Python package, you need to restore the front-end extension link | ||
| jupyter labextension develop . --overwrite | ||
| ``` | ||
|
|
||
| To execute them, run: | ||
|
|
||
| ```sh | ||
| pytest -vv -r ap --cov jupyterlab_deepnote | ||
| ``` | ||
|
|
||
| ### Frontend tests | ||
|
|
||
| This extension is using [Jest](https://jestjs.io/) for JavaScript code testing. | ||
|
|
||
| To execute them, execute: | ||
|
|
||
| ```sh | ||
| jlpm | ||
| jlpm test | ||
| ``` | ||
|
|
||
| ## Versioning and compatibility | ||
|
|
||
| We follow [Semantic Versioning (semver)](https://semver.org/). | ||
|
|
||
| The extension pins JupyterLab to the current major version in both Python and JavaScript dependencies to ensure compatibility. | ||
|
|
||
| **Example `pyproject.toml` dependency:** | ||
|
|
||
| ```toml | ||
| [project.optional-dependencies] | ||
| jupyterlab = ["jupyterlab>=4.0.0,<5.0.0"] | ||
| ``` | ||
|
|
||
| **Example `package.json` peerDependencies:** | ||
|
|
||
| ```json | ||
| "peerDependencies": { | ||
| "@jupyterlab/application": "^4.0.0", | ||
| "@jupyterlab/apputils": "^4.0.0", | ||
| "jupyterlab": "^4.0.0" | ||
| } | ||
| ``` | ||
|
|
||
| ## Sync with the JupyterLab extension template | ||
|
|
||
| This project was bootstrapped using the [JupyterLab extension template](https://github.com/jupyterlab/extension-template). To keep your project up to date with improvements and best practices from the template, run: | ||
|
|
||
| ```sh | ||
| copier update --trust | ||
| ``` | ||
|
|
||
| This will apply the latest template changes interactively. Review and commit any updates as appropriate. | ||
|
|
||
| ## Release workflow | ||
|
|
||
| See [RELEASE](RELEASE.md) for details on the release process. We recommend using [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser) and [PyPI trusted publishing](https://docs.pypi.org/trusted-publishers/) for secure and automated releases. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.