diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491f..0000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/.gitignore b/.gitignore index e28cffa..e3fb872 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/*.tar.xz +/*.tar.gz /*.zip diff --git a/plans/ci.fmf b/plans/ci.fmf deleted file mode 100644 index d890aec..0000000 --- a/plans/ci.fmf +++ /dev/null @@ -1,6 +0,0 @@ -summary: Run CI tests -discover: - how: fmf -execute: - how: tmt - diff --git a/python-ruamel-yaml.spec b/python-ruamel-yaml.spec index 93c571e..4d24128 100644 --- a/python-ruamel-yaml.spec +++ b/python-ruamel-yaml.spec @@ -1,8 +1,10 @@ # Breaks the circular dependency with ruamel.yaml.clib. %bcond_with bootstrap +%global commit 6f41eb6001661917fceb0e88ed0693ae1a7c50f4 + Name: python-ruamel-yaml -Version: 0.19.1 +Version: 0.18.6 Release: %autorelease Summary: YAML 1.2 loader/dumper package for Python @@ -10,7 +12,7 @@ Summary: YAML 1.2 loader/dumper package for Python License: MIT URL: https://sourceforge.net/projects/ruamel-yaml # The PyPI sdist does not contain tests, so we use a snapshot from SourceForge -Source: https://yaml.dev/ruamel-dl-tagged-releases/ruamel.yaml-%{version}.tar.xz +Source: https://sourceforge.net/code-snapshots/hg/r/ru/ruamel-yaml/code/ruamel-yaml-code-%{commit}.zip BuildArch: noarch @@ -28,19 +30,20 @@ BuildRequires: python3-pytest %py_provides python3-ruamel.yaml -%if !%{with bootstrap} -# ruamel.yaml.clibz is not available in Fedora (and probably never will -# be), so require the old clib backend -Requires: python3-ruamel-yaml+oldlibyaml = %{version}-%{release} -%endif - %description -n python3-ruamel-yaml %{_description} %prep -%autosetup -n ruamel.yaml-%{version} +%autosetup -n ruamel-yaml-code-%{commit} +# Upstream upper-bounds the Python interpeter versions with which the C +# implementation (ruamel.yaml.clib dependency) may be used. Patch this out. +sed -r -i 's/( and python_version<"[^"]+")(.*ruamel\.yaml\.clib)/\2/' \ + __init__.py +%if %{with bootstrap} +sed -r -i 's/^([[:blank:]]*)(.*ruamel\.yaml\.clib)/\1# \2/' __init__.py +%endif %generate_buildrequires -%pyproject_buildrequires %{!?with_bootstrap:-x oldlibyaml} +%pyproject_buildrequires %build %pyproject_wheel @@ -62,7 +65,5 @@ k="${k-}${k+ and }not test_dump_cyaml_1_2" %files -n python3-ruamel-yaml -f %{pyproject_files} %doc README.md -%pyproject_extras_subpkg -n python3-ruamel-yaml oldlibyaml - %changelog %autochangelog diff --git a/sources b/sources index f0e723c..f52e86d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ruamel.yaml-0.19.1.tar.xz) = bf9eb8e40f506d6f3f34aee5f5ec74eb93bfda2b27022f6ad62dfac724b9e0847d61e3159d284bada7dec147992aaf509804f7139818de5bc85aa328bc32601f +SHA512 (ruamel-yaml-code-6f41eb6001661917fceb0e88ed0693ae1a7c50f4.zip) = 49fc9ef87e59b723803659300a8dc2c33d596bc2e1effa5235f26cf51fb08c0e6e0d2c386d54c290f97d63dc2a8956802a02c90e4a52881a2cd5d38daf1b0318 diff --git a/tests/main.fmf b/tests/main.fmf deleted file mode 100644 index 1cfafe2..0000000 --- a/tests/main.fmf +++ /dev/null @@ -1 +0,0 @@ -component: python-ruamel-yaml diff --git a/tests/sf534/main.fmf b/tests/sf534/main.fmf deleted file mode 100644 index 5480ac5..0000000 --- a/tests/sf534/main.fmf +++ /dev/null @@ -1,5 +0,0 @@ -summary: Regression test for upstream ticket 534 -require: python3-ruamel-yaml -link: - - verifies: https://sourceforge.net/p/ruamel-yaml/tickets/534/ -test: python3 test.py diff --git a/tests/sf534/test.py b/tests/sf534/test.py deleted file mode 100644 index 8302605..0000000 --- a/tests/sf534/test.py +++ /dev/null @@ -1,32 +0,0 @@ -# Taken from https://sourceforge.net/p/ruamel-yaml/tickets/534/ - -from io import StringIO -from ruamel.yaml import YAML - -original = '0: foo\n' -py_original = {0: 'foo'} -prefix = '%YAML 1.1\n---\n' - -yaml = YAML() -yaml.version = (1, 1) - -loaded = yaml.load(original) -assert loaded == py_original - -print('Fresh') -stream = StringIO() -yaml.dump(py_original, stream) -fresh = stream.getvalue() -print(fresh) -assert fresh.startswith(prefix) -trimmed = fresh[len(prefix):] -assert trimmed == original, f"{trimmed!r} != {original!r}" - -print('Round trip') -stream = StringIO() -yaml.dump(loaded, stream) -round_tripped = stream.getvalue() -print(round_tripped) -assert round_tripped.startswith(prefix) -trimmed = round_tripped[len(prefix):] -assert trimmed == original, f"{trimmed!r} != {original!r}"