diff --git a/python-jupytext-chdir.patch b/python-jupytext-chdir.patch new file mode 100644 index 0000000..1281b64 --- /dev/null +++ b/python-jupytext-chdir.patch @@ -0,0 +1,30 @@ +Fixes this error: + +_____________ ERROR at setup of test_cm_config_log_only_if_changed _____________ + +tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_cm_config_log_only_if_cha0') + + @pytest.fixture() + def cwd_tmp_path(tmp_path): + # Run the whole test from inside tmp_path +> with tmp_path.cwd(): +E TypeError: 'PosixPath' object does not support the context manager protocol + +/builddir/build/BUILD/python-jupytext-1.16.2-build/jupytext-1.16.2/tests/conftest.py:50: TypeError + +--- jupytext-1.16.2/tests/conftest.py.orig 2024-05-05 16:34:48.000000000 -0600 ++++ jupytext-1.16.2/tests/conftest.py 2024-06-18 08:13:53.192133400 -0600 +@@ -1,3 +1,4 @@ ++import contextlib + import itertools + import os.path + import re +@@ -47,7 +48,7 @@ def cwd_tmpdir(tmpdir): + @pytest.fixture() + def cwd_tmp_path(tmp_path): + # Run the whole test from inside tmp_path +- with tmp_path.cwd(): ++ with contextlib.chdir(tmp_path): + yield tmp_path + + diff --git a/python-jupytext-maxsplit.patch b/python-jupytext-maxsplit.patch new file mode 100644 index 0000000..250d8d3 --- /dev/null +++ b/python-jupytext-maxsplit.patch @@ -0,0 +1,16 @@ +Fixes this warning: + + /builddir/build/BUILD/python-jupytext-1.16.2-build/BUILDROOT/usr/lib/python3.13/site-packages/jupytext/cell_metadata.py:260: DeprecationWarning: 'maxsplit' is passed as positional argument + options = re.split(r"\s|,", options, 1) + +--- jupytext-1.16.2/src/jupytext/cell_metadata.py.orig 2024-05-05 16:34:48.000000000 -0600 ++++ jupytext-1.16.2/src/jupytext/cell_metadata.py 2024-06-18 08:15:50.518408511 -0600 +@@ -257,7 +257,7 @@ def parse_rmd_options(line): + + def rmd_options_to_metadata(options, use_runtools=False): + """Parse rmd options and return a metadata dictionary""" +- options = re.split(r"\s|,", options, 1) ++ options = re.split(r"\s|,", options, maxsplit=1) + # Special case Wolfram Language, which sadly has a space in the language + # name. + if options[0:2] == ["wolfram", "language"]: diff --git a/python-jupytext.spec b/python-jupytext.spec index 86a8218..16fc492 100644 --- a/python-jupytext.spec +++ b/python-jupytext.spec @@ -15,6 +15,12 @@ Source0: %{vcs}/archive/v%{version}/jupytext-%{version}.tar.gz Source1: jupytext-%{version}-vendor.tar.xz Source2: jupytext-%{version}-vendor-licenses.txt Source3: prepare_vendor.sh +# Adapt to python 3.13 change in PosixPath.cwd +# See https://github.com/mwouts/jupytext/issues/1242 +Patch0: %{name}-chdir.patch +# Fix a DeprecationWarning with passing maxsplit as a positional argument +# See https://github.com/mwouts/jupytext/pull/1241 +Patch1: %{name}-maxsplit.patch # s390x builds fail due to a bug in jupyterlab # https://bugzilla.redhat.com/show_bug.cgi?id=2278011