New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New option --use-source-timestamp #790
Conversation
b9cdd8c
to
5671997
Compare
Hi @DancingQuanta, @Midnighter, would you like to give a try at this PR that introduces a new NB: to install the version locally, use
See https://jupytext.readthedocs.io/en/latest/developing.html for more details. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #790 +/- ##
==========================================
+ Coverage 99.11% 99.13% +0.01%
==========================================
Files 106 106
Lines 10100 10138 +38
==========================================
+ Hits 10011 10050 +39
+ Misses 89 88 -1
Continue to review full report at Codecov.
|
Thank you for the quick response @mwouts. I've tried this branch and the I also tried it without that flag, |
Adjust 'formats', if required, before writing the notebook
5671997
to
47e96f8
Compare
Thank you @Midnighter for your feedback! Glad it works as expected 😄 I'll fix (I mean... ignore) the sub-micro second timestamp issue on mac os (https://github.com/mwouts/jupytext/pull/790/checks?check_run_id=2702174937) and merge this
|
@@ -1335,7 +1335,8 @@ def test_use_source_timestamp(tmpdir, cwd_tmpdir, python_notebook, capsys, forma | |||
assert "Updating the timestamp" not in capture.out | |||
|
|||
dest_timestamp = test_ipynb.stat().mtime | |||
assert src_timestamp == dest_timestamp | |||
# on Mac OS the dest_timestamp is truncated at the microsecond (#790) | |||
assert src_timestamp - 1e-6 <= dest_timestamp <= src_timestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you use pytest, you could use pytest.approx here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's right... I like very much pytest.approx
indeed! But here maybe the micro-second truncation is a bit more specific than a numerical uncertainty? Anyway thanks for commenting!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point!
Fixes #784