jupytext icon indicating copy to clipboard operation
jupytext copied to clipboard

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

Open mwouts opened this issue 1 year ago • 2 comments

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 avatar Feb 03 '24 22:02 mwouts

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

mwouts avatar Feb 15 '24 18:02 mwouts

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.

mwouts avatar Feb 15 '24 18:02 mwouts