mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.6k stars 386 forks source link

The Jupytext pre-commit hook fails to install when node is not available #1210

Closed mwouts closed 4 months ago

mwouts commented 7 months ago

The Jupytext pre-commit hook documented here fails to install when selecting v1.16.0 or above.

This is because node is required to build the JupyterLab extension for Jupytext.

We need to figure out how to not build the extension (e.g. set HATCH_BUILD_HOOKS_ENABLE=false) when jupytext is installed by pre-commit.

The current workaround is to use Jupytext in version v1.15.2 in the pre-commit hooks.

mwouts commented 7 months ago

I can reproduce the issue with tests/external/pre_commit/test_pre_commit_1_sync.py when node is not installed.

mwouts commented 7 months ago

What I think we could do is set HATCH_BUILD_HOOKS_ENABLE=false for when the jupytext pre-commit hook is installed. There are many similar questions on the pre-commit project, see e.g. https://github.com/pre-commit/pre-commit/issues/2367, but it is not yet obvious to me how we can set a variable for the hook installation.