diff --git a/CHANGELOG.md b/CHANGELOG.md index 27ff8270..ecfbac20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,11 @@ Jupytext ChangeLog **Fixed** - The `rst2md` tests have been fixed by requiring `sphinx<8` ([#1266](https://github.com/mwouts/jupytext/issues/1266)) - Some dependencies of the JupyterLab extensions were updated ([#1272](https://github.com/mwouts/jupytext/issues/1272), [#1273](https://github.com/mwouts/jupytext/issues/1273), [#1280](https://github.com/mwouts/jupytext/issues/1280), [#1285](https://github.com/mwouts/jupytext/issues/1285), [#1290](https://github.com/mwouts/jupytext/issues/1290)) -- The pre-commit hook is now compatible with log.showsignature=True (#1281). Thanks to [Justin Lecher](https://github.com/jlec) for this fix. +- The pre-commit hook is now compatible with log.showsignature=True ([#1281](https://github.com/mwouts/jupytext/issues/1281)). Thanks to [Justin Lecher](https://github.com/jlec) for this fix. **Added** - Jupytext is now tested with Python 3.13 ([#1242](https://github.com/mwouts/jupytext/issues/1242)). Thanks to [Jerry James](https://github.com/jamesjer) for the suggested fixes! +- The extension of a notebook piped into stdin will be taken in the notebook metadata ([#1282](https://github.com/mwouts/jupytext/issues/1282)) 1.16.4 (2024-07-12) diff --git a/environment.yml b/environment.yml index 52f63845..b2b30d51 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,5 @@ name: jupytext-dev channels: - - defaults - conda-forge dependencies: - python>=3.8 diff --git a/jupyterlab/packages/jupyterlab-jupytext-extension/CHANGELOG.md b/jupyterlab/packages/jupyterlab-jupytext-extension/CHANGELOG.md index 3a7c3316..3716cefa 100644 --- a/jupyterlab/packages/jupyterlab-jupytext-extension/CHANGELOG.md +++ b/jupyterlab/packages/jupyterlab-jupytext-extension/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.4.3+dev + +Some dependencies of the JupyterLab extensions were updated ([#1272](https://github.com/mwouts/jupytext/issues/1272), [#1273](https://github.com/mwouts/jupytext/issues/1273), [#1280](https://github.com/mwouts/jupytext/issues/1280), [#1285](https://github.com/mwouts/jupytext/issues/1285), [#1290](https://github.com/mwouts/jupytext/issues/1290)) + # 1.4.3 (2024-05-05) - JupyterLab's dependency `ejs` was updated from 3.1.9 to 3.1.10 ([#1231](https://github.com/mwouts/jupytext/issues/1231)) diff --git a/src/jupytext/formats.py b/src/jupytext/formats.py index efed28cd..91c3b773 100644 --- a/src/jupytext/formats.py +++ b/src/jupytext/formats.py @@ -418,10 +418,14 @@ def check_file_version(notebook, source_path, outputs_path): if not insert_or_test_version_number(): return - _, ext = os.path.splitext(source_path) - assert not ext.endswith(".ipynb"), "source_path={} should be a text file".format( - source_path - ) + if source_path == "-": + # https://github.com/mwouts/jupytext/issues/1282 + ext = notebook.metadata["jupytext"]["text_representation"]["extension"] + else: + _, ext = os.path.splitext(source_path) + assert not ext.endswith( + ".ipynb" + ), "source_path={} should be a text file".format(source_path) version = ( notebook.metadata.get("jupytext", {})