Developing Jupytext
How to test development versions from GitHub
Section titled “How to test development versions from GitHub”If you want to test a feature that has been integrated in main but not delivered yet to pip or conda, use
HATCH_BUILD_HOOKS_ENABLE=true pip install git+https://github.com/mwouts/jupytext.gitThe above requires node. You can install it with e.g.
conda install 'nodejs>=20' -c conda-forgeAlternatively you can build only Jupytext core (e.g. skip the JupyterLab extension). To do so, remove HATCH_BUILD_HOOKS_ENABLE=true in the above.
Finally, if you want to test a development branch, use
HATCH_BUILD_HOOKS_ENABLE=true pip install git+https://github.com/mwouts/jupytext.git@branchwhere branch is the name of the branch you want to test.
Install and develop Jupytext locally
Section titled “Install and develop Jupytext locally”Most of Jupytext’s code is written in Python. To develop the Python part of Jupytext, you should clone Jupytext, then create a dedicated Python environment with Pixi:
pixi shellInstall the jupytext package in development mode with
HATCH_BUILD_HOOKS_ENABLE=true pip install -e '.[dev]'We use the pre-commit package to run pre-commit scripts like black and ruff on the code.
Install it with
pre-commit installTests are executed with pytest. You can run them in parallel with for instance
pytest -n 5Some tests require a Jupyter kernel pointing to the current environment:
python -m ipykernel install --name jupytext-dev --userJupytext’s extension for JupyterLab
Section titled “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.
Jupytext’s documentation
Section titled “Jupytext’s documentation”You can build the HTML documentation locally with
rm -rf docs/_buildpixi run -e docs sphinx-build docs docs/_build