Closed mwouts closed 4 months ago
Thank you for making this pull request.
Did you know? You can try it on Binder: or .
Also, the version of Jupytext developed in this PR can be installed with pip
:
pip install git+https://github.com/mwouts/jupytext.git@no_extension_in_pre_commit_envs
(this requires nodejs
, see more at Developing Jupytext)
Apparently I have been able to require jupyterlab>=4
dynamically, and now the test runs in only 8 seconds.
Apparently I have been able to require
jupyterlab>=4
dynamically, and now the test runs in only 8 seconds.
Well apparently that did not work :cry: (the dev install fails on the CI)
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.73%. Comparing base (
642c709
) to head (c607e7d
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
As discussed above, I have merged #1233 instead - thanks @mahendrapaipuri for your advice!
With this PR, the extension is not build when the Python executable looks like a pre-commit environment.
Closes #1210
After this PR, the test
tests/external/pre_commit/test_pre_commit_1_sync_with_no_config.py
runs in 25 seconds (was 54 seconds previously).At least this should fix the issue that Jupytext can't be installed in a pre-commit hook env when npm is not present.
If I new how to do that, I would prefer to not even take a dependency on
hatch-jupyter-builder
andjupyterlab
(I think that's where most of the 25 seconds come from).I see that it is possible to have dynamical values in the
project
table (e.g.version
, or evendependencies
, so I have been thinking of writing a hook that would identify pre-commit environments and set e.g. abuild_for_pre_commit_env
variable, but then @mahendrapaipuri do you think I could use that variable to skip the extension build?