Skip to content

Commit

Permalink
Update the development instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Nov 9, 2023
1 parent 7cab8d1 commit cd2f9aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
11 changes: 1 addition & 10 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
15 changes: 7 additions & 8 deletions jupyterlab/packages/jupyterlab-jupytext-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] # for JupyterLab 3.x
jupyter labextension install [email protected] # for JupyterLab 2.x
jupyter labextension install [email protected] # 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

Expand Down

0 comments on commit cd2f9aa

Please sign in to comment.