From cd2f9aa8d2991b5ef21098a9d74046d361ab5af1 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Thu, 9 Nov 2023 20:56:37 +0000 Subject: [PATCH] Update the development instructions --- docs/developing.md | 11 +---------- .../jupyterlab-jupytext-extension/README.md | 15 +++++++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/docs/developing.md b/docs/developing.md index 66d76298d..5c78aa2a6 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -26,7 +26,7 @@ conda activate jupytext-dev Install the `jupytext` package in development mode with ``` -pip install '.[dev]' +pip install -e '.[dev]' ``` We use the [pre-commit](https://pre-commit.com) package to run pre-commit scripts like `black` and `ruff` on the code. @@ -45,15 +45,6 @@ Some tests require a Jupyter kernel pointing to the current environment: python -m ipykernel install --name jupytext-dev --user ``` -Finally, you can build the package and install it with -``` -pip install -U build wheel -python -m build -pip install dist/jupytext-x.x.x-py3-none-any.whl -``` - -Note that you can use `HATCH_BUILD_HOOKS_ENABLE=false` if you don't need the lab extension - the build time will be slightly shorter. - ## Jupytext's extension for JupyterLab Our extension for JupyterLab adds a series of Jupytext commands to JupyterLab. The code is in `packages/labextension`. See the `README.md` there for instructions on how to develop that extension. diff --git a/jupyterlab/packages/jupyterlab-jupytext-extension/README.md b/jupyterlab/packages/jupyterlab-jupytext-extension/README.md index 7c29efcc2..d36e2d420 100644 --- a/jupyterlab/packages/jupyterlab-jupytext-extension/README.md +++ b/jupyterlab/packages/jupyterlab-jupytext-extension/README.md @@ -13,26 +13,25 @@ Most users do not need to install this extension, since it is already included i Please install [Jupytext](https://github.com/mwouts/jupytext/blob/main/README.md#Install) first. As mentioned above, both the `pip` and `conda` packages do include the latest version of the JupyterLab extension, so in most cases you don't need to specifically install this `npm` package. -In case you're not using JupyterLab 3.x, you will have to install an older version of the extension that is compatible with your version. Please first install `jupytext` using `pip` or `conda`, and then downgrade the extension to a version compatible with your version of Jupyter Lab with: +In case you're not using JupyterLab 4.x, you will have to install an older version of the extension that is compatible with your version. Please first install `jupytext` using `pip` or `conda`, and then downgrade the extension to a version compatible with your version of Jupyter Lab with: ```bash +jupyter labextension install jupyterlab-jupytext@1.3.11 # for JupyterLab 3.x jupyter labextension install jupyterlab-jupytext@1.2.2 # for JupyterLab 2.x jupyter labextension install jupyterlab-jupytext@1.1.1 # for JupyterLab 1.x ``` # How to develop this extension -We assume that you have activated the conda environment described in [CONTRIBUTING.md](https://github.com/mwouts/jupytext/blob/main/CONTRIBUTING.md). - -Then you can rebuild the Jupytext python package (with `python -m build`) and reinstall it (`pip install dist/jupytext-x.x.x-py3-none-any.whl`). - -Alternatively, if you prefer to develop iteratively, you could install a development version of the extension with +Please follow the instructions at [developing.md](../../../docs/developing.md), i.e. +create a Python environment with a recent version of `nodejs`, and install +a development version of Jupytext by running ```bash -jupyter labextension develop . --overwrite +pip install -e '.[dev]' ``` -Read more on this on the [JupyterLab documentation](https://jupyterlab.readthedocs.io/en/latest/extension/extension_dev.html#developing-a-prebuilt-extension). +at the root of the Jupytext repository. # How to publish a new version of the extension on npm