Compare commits
15 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdec57db9d |
||
|
|
d39270652a |
||
|
|
b7baece53f |
||
|
|
dbfc5f0666 | ||
|
|
7e8dc99058 |
||
|
|
a45b1d803f | ||
|
|
b9a3871a83 | ||
|
|
209e8e8f4a |
||
|
|
4236d32316 | ||
|
|
c7cb48c9c1 | ||
|
|
829e0922a3 | ||
|
|
f4ffb1b349 |
||
|
|
6399b356b8 |
||
|
|
7ce90a3638 | ||
|
|
b8c60a3bec |
8 changed files with 59 additions and 15 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
/*.tar.gz
|
/*.tar.xz
|
||||||
/*.zip
|
/*.zip
|
||||||
|
|
|
||||||
6
plans/ci.fmf
Normal file
6
plans/ci.fmf
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
summary: Run CI tests
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
# Breaks the circular dependency with ruamel.yaml.clib.
|
# Breaks the circular dependency with ruamel.yaml.clib.
|
||||||
%bcond_with bootstrap
|
%bcond_with bootstrap
|
||||||
|
|
||||||
%global commit 6f41eb6001661917fceb0e88ed0693ae1a7c50f4
|
|
||||||
|
|
||||||
Name: python-ruamel-yaml
|
Name: python-ruamel-yaml
|
||||||
Version: 0.18.6
|
Version: 0.19.1
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
Summary: YAML 1.2 loader/dumper package for Python
|
Summary: YAML 1.2 loader/dumper package for Python
|
||||||
|
|
||||||
|
|
@ -12,7 +10,7 @@ Summary: YAML 1.2 loader/dumper package for Python
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://sourceforge.net/projects/ruamel-yaml
|
URL: https://sourceforge.net/projects/ruamel-yaml
|
||||||
# The PyPI sdist does not contain tests, so we use a snapshot from SourceForge
|
# The PyPI sdist does not contain tests, so we use a snapshot from SourceForge
|
||||||
Source: https://sourceforge.net/code-snapshots/hg/r/ru/ruamel-yaml/code/ruamel-yaml-code-%{commit}.zip
|
Source: https://yaml.dev/ruamel-dl-tagged-releases/ruamel.yaml-%{version}.tar.xz
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
|
@ -30,20 +28,19 @@ BuildRequires: python3-pytest
|
||||||
|
|
||||||
%py_provides python3-ruamel.yaml
|
%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}
|
%description -n python3-ruamel-yaml %{_description}
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n ruamel-yaml-code-%{commit}
|
%autosetup -n ruamel.yaml-%{version}
|
||||||
# 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
|
%generate_buildrequires
|
||||||
%pyproject_buildrequires
|
%pyproject_buildrequires %{!?with_bootstrap:-x oldlibyaml}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
|
@ -65,5 +62,7 @@ k="${k-}${k+ and }not test_dump_cyaml_1_2"
|
||||||
%files -n python3-ruamel-yaml -f %{pyproject_files}
|
%files -n python3-ruamel-yaml -f %{pyproject_files}
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
|
||||||
|
%pyproject_extras_subpkg -n python3-ruamel-yaml oldlibyaml
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
%autochangelog
|
%autochangelog
|
||||||
|
|
|
||||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
||||||
SHA512 (ruamel-yaml-code-6f41eb6001661917fceb0e88ed0693ae1a7c50f4.zip) = 49fc9ef87e59b723803659300a8dc2c33d596bc2e1effa5235f26cf51fb08c0e6e0d2c386d54c290f97d63dc2a8956802a02c90e4a52881a2cd5d38daf1b0318
|
SHA512 (ruamel.yaml-0.19.1.tar.xz) = bf9eb8e40f506d6f3f34aee5f5ec74eb93bfda2b27022f6ad62dfac724b9e0847d61e3159d284bada7dec147992aaf509804f7139818de5bc85aa328bc32601f
|
||||||
|
|
|
||||||
1
tests/main.fmf
Normal file
1
tests/main.fmf
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
component: python-ruamel-yaml
|
||||||
5
tests/sf534/main.fmf
Normal file
5
tests/sf534/main.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
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
|
||||||
32
tests/sf534/test.py
Normal file
32
tests/sf534/test.py
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# 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}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue