From 60dfc993bf5ba573378082d4d30bf356911fee37 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 18:03:07 +0000 Subject: [PATCH] import UBI python-ruamel-yaml-0.18.5-5.el10 --- .gitignore | 2 +- bz-1951852-test.py | 37 ----- python-ruamel-yaml-pathlib.patch | 56 -------- python-ruamel-yaml-pytest27.patch | 18 --- python-ruamel-yaml.spec | 228 ++++++++++++++++++++++-------- sources | 2 +- 6 files changed, 168 insertions(+), 175 deletions(-) delete mode 100644 bz-1951852-test.py delete mode 100644 python-ruamel-yaml-pathlib.patch delete mode 100644 python-ruamel-yaml-pytest27.patch diff --git a/.gitignore b/.gitignore index d9c1e4d..7b7ce97 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2.zip +ruamel-yaml-code-eb3ecf31085135283908fc8449befebbc1fff4b3.zip diff --git a/bz-1951852-test.py b/bz-1951852-test.py deleted file mode 100644 index 0287df2..0000000 --- a/bz-1951852-test.py +++ /dev/null @@ -1,37 +0,0 @@ -import io -import sys -import ruamel.yaml -from ruamel.yaml import YAML - -ruamel_yaml = YAML(typ="rt") -ruamel_yaml.default_flow_style = False -ruamel_yaml.preserve_quotes = True -ruamel_yaml.width = 1024 - -buf = """\ -# top level -top: - # next level 1 - - { here: 1, there: 2 } - # next level 2 - - { there: 1, here: 2 } -top2: - # next level 1-2 - - { here: 11, there: 22 } - # next level 2-2 - - { there: 11, here: 22 } -""" - -if len(sys.argv) > 1: - buf = open(sys.argv[1]).read() -ruamel_data = ruamel_yaml.load(buf) -ruamel_yaml.indent(mapping=2, sequence=4, offset=2) -outf = io.StringIO() -ruamel_yaml.dump(ruamel_data, outf) -buf = outf.getvalue() -print(buf) -ruamel_data = ruamel_yaml.load(buf) -outf = io.StringIO() -ruamel_yaml.dump(ruamel_data, outf) -buf = outf.getvalue() -print(buf) diff --git a/python-ruamel-yaml-pathlib.patch b/python-ruamel-yaml-pathlib.patch deleted file mode 100644 index e18fff8..0000000 --- a/python-ruamel-yaml-pathlib.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_doc/conf.py.orig 2021-04-20 17:11:58.090894727 -0600 -+++ ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_doc/conf.py 2021-04-20 17:13:38.946521358 -0600 -@@ -75,7 +75,10 @@ class ryd2rst: - if False: - try: - from ryd.__main__ import RYDCmd -- from ruamel.std.pathlib import Path -+ try: -+ from pathlib import Path -+ except ImportError: -+ from pathlib2 import Path - - oldargv = sys.argv - for fn in Path('.').glob('*.ryd'): ---- ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/test_api_change.py.orig 2021-04-20 17:12:13.434990060 -0600 -+++ ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/test_api_change.py 2021-04-20 17:13:58.317641717 -0600 -@@ -9,7 +9,10 @@ testing of anchors and the aliases refer - import sys - import textwrap - import pytest --from ruamel.std.pathlib import Path -+try: -+ from pathlib import Path -+except ImportError: -+ from pathlib2 import Path - - - class TestNewAPI: ---- ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/roundtrip.py.orig 2021-04-20 17:25:36.621971457 -0600 -+++ ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/roundtrip.py 2021-04-20 17:26:47.303408002 -0600 -@@ -7,7 +7,10 @@ helper routines for testing round trip o - """ - import sys - import textwrap --from ruamel.std.pathlib import Path -+try: -+ from pathlib import Path -+except ImportError: -+ from pathlib2 import Path - - enforce = object() - ---- ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/test_z_data.py.orig 2021-04-20 17:26:30.851306390 -0600 -+++ ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/test_z_data.py 2021-04-20 17:26:40.850368147 -0600 -@@ -6,7 +6,10 @@ import sys - import pytest # NOQA - import warnings # NOQA - --from ruamel.std.pathlib import Path -+try: -+ from pathlib import Path -+except ImportError: -+ from pathlib2 import Path - - base_path = Path('data') # that is ruamel.yaml.data - PY2 = sys.version_info[0] == 2 diff --git a/python-ruamel-yaml-pytest27.patch b/python-ruamel-yaml-pytest27.patch deleted file mode 100644 index ef7d17a..0000000 --- a/python-ruamel-yaml-pytest27.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/test_anchor.py.orig 2021-04-20 17:09:14.371877519 -0600 -+++ ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2/_test/test_anchor.py 2021-04-20 17:09:45.359070044 -0600 -@@ -7,6 +7,7 @@ testing of anchors and the aliases refer - """ - - import pytest -+from distutils.version import LooseVersion - from textwrap import dedent - import platform - -@@ -248,6 +249,7 @@ class TestAnchorsAliases: - ) - - # this is an error in PyYAML -+ @pytest.mark.skipif(LooseVersion(pytest.__version__) < LooseVersion("2.8"), reason="Need pytest 2.7") - def test_reused_anchor(self): - from ruamel.yaml.error import ReusedAnchorWarning - diff --git a/python-ruamel-yaml.spec b/python-ruamel-yaml.spec index adee591..85a4acc 100644 --- a/python-ruamel-yaml.spec +++ b/python-ruamel-yaml.spec @@ -1,88 +1,192 @@ -%global pypi_name ruamel.yaml -%global pname ruamel-yaml -%global commit af9628b0d0479c35a60efc44b8d6dff9dc95aed2 +# Breaks the circular dependency with ruamel.yaml.clib. +%bcond_with bootstrap +%global commit eb3ecf31085135283908fc8449befebbc1fff4b3 -Name: python-%{pname} -Version: 0.15.100 -Release: 1%{?dist} -Summary: YAML 1.2 loader/dumper package for Python +Name: python-ruamel-yaml +Version: 0.18.5 +Release: 5%{?dist} +Summary: YAML 1.2 loader/dumper package for Python +# SPDX License: MIT -URL: https://sourceforge.net/projects/ruamel-yaml/ -#Source0: https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz -# Use bitbucket sources so we can run the tests -#Source0: https://bitbucket.org/ruamel/yaml/get/%{version}.tar.gz#/%{pname}-%{version}.tar.gz -# moved to sourceforge -Source0: https://sourceforge.net/code-snapshots/hg/r/ru/%{pname}/code/%{pname}-code-%{commit}.zip -Source1: bz-1951852-test.py +URL: https://sourceforge.net/projects/ruamel-yaml +# 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 -# Works with pytest 2.7 -Patch0: python-ruamel-yaml-pytest27.patch +BuildArch: noarch -# Don't require ruamel.std.pathlib, but use stdlib's pathlib on py3, pathlib2 on py2 -Patch1: python-ruamel-yaml-pathlib.patch - -BuildRequires: gcc -BuildRequires: libyaml-devel +%global _description %{expand: +ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of +comments, seq/map flow style, and map key order.} -%description -ruamel.yaml is a YAML 1.2 loader/dumper package for Python. -It is a derivative of Kirill Simonov’s PyYAML 3.11 +%description %{_description} -%package -n python%{python3_pkgversion}-%{pname} -Summary: YAML 1.2 loader/dumper package for Python -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-setuptools -# For tests -BuildRequires: python%{python3_pkgversion}-pytest -# typing was added in Python 3.5 -%if %{python3_pkgversion} == 34 -BuildRequires: python%{python3_pkgversion}-typing -%endif -%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} +%package -n python3-ruamel-yaml +Summary: YAML 1.2 loader/dumper package for Python -Requires: python%{python3_pkgversion}-setuptools -%if %{python3_pkgversion} == 34 -Requires: python%{python3_pkgversion}-typing -%endif +BuildRequires: python3-devel +BuildRequires: python3-pytest -%description -n python%{python3_pkgversion}-%{pname} -ruamel.yaml is a YAML 1.2 loader/dumper package for Python. -It is a derivative of Kirill Simonov’s PyYAML 3.11 +%py_provides python3-ruamel.yaml + +%description -n python3-ruamel-yaml %{_description} %prep -%autosetup -n %{pname}-code-%{commit} -p1 -rm -rf %{pypi_name}.egg-info +%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 %build -%py3_build +%pyproject_wheel %install -%{__python3} setup.py install --single-version-externally-managed --skip-build --root $RPM_BUILD_ROOT +%pyproject_install +# RFE: Add option for namespace packages to %%pyproject_save_files +# https://bugzilla.redhat.com/show_bug.cgi?id=1935266 +%pyproject_save_files ruamel %check -PYTHONPATH=$(echo build/lib.*%{python3_version}) py.test-%{python3_version} _test/test_*.py -PYTHONPATH=$(echo build/lib.*%{python3_version}) %{__python3} %{SOURCE1} +%if %{with bootstrap} +k="${k-}${k+ and }not test_load_cyaml" +k="${k-}${k+ and }not test_load_cyaml_1_2" +k="${k-}${k+ and }not test_dump_cyaml_1_2" +%endif +%pytest -k "${k-}" _test/test_*.py -%files -n python%{python3_pkgversion}-%{pname} -%license LICENSE -%doc README.rst -%{python3_sitearch}/ruamel -%{python3_sitearch}/_ruamel_yaml.cpython-* -%{python3_sitearch}/%{pypi_name}-%{version}-py?.?-*.pth -%{python3_sitearch}/%{pypi_name}-%{version}-py?.?.egg-info +%files -n python3-ruamel-yaml -f %{pyproject_files} +# pyproject_files handles LICENSE; verify with “rpm -qL -p …” +%doc README.md %changelog -* Tue Apr 20 2021 Rich Megginson - 0.15.100-1 -- Resolves: rhbz#1951852 - error converting lists with embedded comments +* Tue Oct 29 2024 Troy Dawson - 0.18.5-5 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 -* Mon Nov 23 2020 Pavel Cahyna - 0.15.41-5 -- Rebuild after adding to RHEL buildrood and configuring CI gating +* Mon Jun 24 2024 Troy Dawson - 0.18.5-4 +- Bump release for June 2024 mass rebuild -* Wed Mar 06 2019 Lon Hohberger - 0.15.41-4 -- Rebuild for new architectures +* Fri Jan 26 2024 Fedora Release Engineering - 0.18.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.18.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Nov 12 2023 Parag Nemade - 0.18.5-1 +- Update to 0.18.5 + +* Thu Oct 26 2023 Joel Capitao - 0.18.2-1 +- Update to 0.18.2 (close RHBZ#2245968) + +* Tue Oct 24 2023 Joel Capitao - 0.18.1-1 +- Update to 0.18.1 (close RHBZ#2241174) + +* Fri Jul 21 2023 Fedora Release Engineering - 0.17.32-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jun 22 2023 Python Maint - 0.17.32-2 +- Rebuilt for Python 3.12 + +* Mon Jun 19 2023 Joel Capitao - 0.17.32-1 +- Update to 0.17.32 (close RHBZ#2210057) + +* Wed Jun 14 2023 Python Maint - 0.17.26-4 +- Rebuilt for Python 3.12 + +* Wed Jun 14 2023 Python Maint - 0.17.26-3 +- Bootstrap for Python 3.12 + +* Wed May 24 2023 Yaakov Selkowitz - 0.17.26-2 +- Avoid tox dependency + +* Tue May 09 2023 Fedora Release Monitoring - 0.17.26-1 +- Update to 0.17.26 (close RHBZ#2196655) + +* Sun May 07 2023 Benjamin A. Beasley - 0.17.24-1 +- Update to 0.17.24 (close RHBZ#2193478) + +* Thu May 04 2023 Benjamin A. Beasley - 0.17.22-2 +- Confirm License is SPDX MIT +- Reduce macro indirection and drop ancient constructs and conditionals +- Update description from upstream +- Make the package noarch (python-ruamel-yaml-clib contains the compiled code) +- Fix upper-bounded Python interpreter version for ruamel.yaml.clib dependency +- Drop unused manual runtime dependency on setuptools +- Port to pyproject-rpm-macros (“new Python guidelines”) +- Stop numbering the source archive +- Add a bootstrap conditional to break the circular dependency with + ruamel.yaml.clib +- Fix an obsolete comment referring to bitbucket + +* Wed May 03 2023 Maxwell G - 0.17.22-1 +- Update to 0.17.22. Fixes rhbz#2192464. + +* Fri Jan 20 2023 Fedora Release Engineering - 0.17.21-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 0.17.21-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 0.17.21-2 +- Rebuilt for Python 3.11 + +* Tue May 10 2022 Jakub Čajka - 0.17.21-1 +- Update to 0.17.21 +- Related: BZ#2042422 + +* Fri Jan 21 2022 Fedora Release Engineering - 0.16.6-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 0.16.6-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.16.6-7 +- Rebuilt for Python 3.10 + +* Mon Feb 22 2021 Joel Capitao - 0.16.6-6 +- Change upstream URL +- Remove obsolete patch + +* Wed Jan 27 2021 Fedora Release Engineering - 0.16.6-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.16.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 0.16.6-3 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.16.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Jan 20 2020 Jason Montleon - 0.16.6-1 +- Update to 0.16.6 + +* Thu Oct 03 2019 Miro Hrončok - 0.16.5-3 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Fri Aug 30 2019 Chandan Kumar - 0.16.5-2 +- Added ruamel-yaml-clib as Requires + +* Tue Aug 27 2019 Chedi Toueiti - 0.16.5-1 +- Update to 0.16.5 + +* Mon Aug 19 2019 Miro Hrončok - 0.15.41-6 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.15.41-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 0.15.41-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Mon Jan 14 2019 Miro Hrončok - 0.15.41-3 - Subpackage python2-ruamel-yaml has been removed diff --git a/sources b/sources index 84fe21c..5412e42 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ruamel-yaml-code-af9628b0d0479c35a60efc44b8d6dff9dc95aed2.zip) = 17f3f070bbdef84f3a166cbb6044ad49983619afdfb723c31d03d094df7a75ffdf393a01053bba0567d862fb6dab8b9e23596a331549f55bab5e652463a7227c +SHA512 (ruamel-yaml-code-eb3ecf31085135283908fc8449befebbc1fff4b3.zip) = 2319ecd339100ec51b060e1fb19d08c3f7603675ce3a17b59c05d11893ca7644d06ececf3950f02eda25cabede6037b5128184823f734f0e66473c5dfdef7cdc