From 0ad1552ff681f2b43d463bb74ddfdece4c64fd23 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Sat, 7 Dec 2024 15:01:52 +0000 Subject: [PATCH 1/3] Remove defaults channel --- environment.yml | 1 - 1 file changed, 1 deletion(-) 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 From 71bb2e07e6ab63b5743c3b8001cc3a76620f7b79 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Sat, 7 Dec 2024 15:02:48 +0000 Subject: [PATCH 2/3] Use metadata to determine the extension of notebooks coming from stdin --- src/jupytext/formats.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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", {}) From 29ffd67db396c5e9c923c261c4eba64a0f2356ec Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Sun, 15 Dec 2024 15:39:05 +0000 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 3 ++- .../packages/jupyterlab-jupytext-extension/CHANGELOG.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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/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))