Closed hhoppe closed 6 months ago
(Another minor annoyance of updating the *.py timestamp is that Emacs warns that it is "reverting the buffer" if it has loaded the file -- even though nothing has changed.)
Hi @hhoppe , thank you for reporting this, and sorry for the delay in getting back to you. Sure that makes sense, let me see what I can do.
A development version with a tentative fix is available at
pip install git+https://github.com/mwouts/jupytext.git@skip_update_timestamp
Would you mind confirming if it does what you are looking for?
Thanks for doing this! I'm away this weekend and will try it on Tuesday.
You're welcome ! No hurry at all. Keep me posted, thanks
I'm having difficulty building the development branch -- maybe it's because I am using WSL.
I first had to apt install nodejs
, but even then I get a build error
YN0009: │ nx@npm:15.9.7 [9d75b] couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-9020d20b/build.log)
where the log contains
Error: Cannot find module 'fs/promises'
I may not be the best person to test this out.
Oh I see - it's not obvious to build the Jupyter Lab extension, sorry about that. Thanks for giving it a try anyway! This should be much easier, and faster too:
HATCH_BUILD_HOOKS_ENABLE=false pip install git+https://github.com/mwouts/jupytext.git@skip_update_timestamp
(the drawback is that you won't get the Jupytext menu in JupyterLab, but maybe you mostly care about the command line?)
The new install command line unfortunately gives the same build error.
No worries! I will test this a bit more on my end, and package the change with the next release, in a few days hopefully.
Hi, I was able to install from the skip_update_timestamp
branch on my side (Fedora & python3.11). The feature seems to work as expected, thanks for the work.
Hi, I was able to install from the
skip_update_timestamp
branch on my side (Fedora & python3.11). The feature seems to work as expected, thanks for the work.
Oh great, thank you @max-accenta for testing it, that's super helpful!
I use
jupytext --sync
frequently across many files to synchronize changes in either direction between .py and .ipynb. Often, no synchronization is necessary and it reports:Is there any way to avoid updating the timestamp on the *.py file if no synchronization changes occur? Could this be made the default behavior?
(I have some later lint tool that unfortunately invalidates its cache as a result.) I see a flag
--use-source-timestamp
but I'm not sure if it is intended for bidirectional synchronization.