Compare commits
No commits in common. "465a6dcb69f63797d8027decc95f19eb610d8186" and "366b20494d6284f44247682a64699208b5434663" have entirely different histories.
465a6dcb69
...
366b20494d
@ -1,39 +0,0 @@
|
|||||||
Author: Michael R. Crusoe <crusoe@debian.org>
|
|
||||||
Description: Default to pure python parsing on big endian systems
|
|
||||||
Forwarded: not-needed
|
|
||||||
|
|
||||||
As the cpython code has an endianness bug https://sourceforge.net/p/ruamel-yaml/tickets/360/
|
|
||||||
|
|
||||||
Thanks to Rebecca N. Palmer for the tip about sys.byteorder!
|
|
||||||
---
|
|
||||||
main.py | 7 ++++++-
|
|
||||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/main.py b/main.py
|
|
||||||
index 9068282..49e70a4 100644
|
|
||||||
--- a/main.py
|
|
||||||
+++ b/main.py
|
|
||||||
@@ -55,7 +55,7 @@ class YAML:
|
|
||||||
self: Any,
|
|
||||||
*,
|
|
||||||
typ: Optional[Union[List[Text], Text]] = None,
|
|
||||||
- pure: Any = False,
|
|
||||||
+ pure: Any = None,
|
|
||||||
output: Any = None,
|
|
||||||
plug_ins: Any = None,
|
|
||||||
) -> None: # input=None,
|
|
||||||
@@ -70,6 +70,11 @@ class YAML:
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.typ = ['rt'] if typ is None else (typ if isinstance(typ, list) else [typ])
|
|
||||||
+ if pure is None:
|
|
||||||
+ if sys.byteorder == 'big':
|
|
||||||
+ pure = True
|
|
||||||
+ else:
|
|
||||||
+ pure = False
|
|
||||||
self.pure = pure
|
|
||||||
|
|
||||||
# self._input = input
|
|
||||||
--
|
|
||||||
2.39.1
|
|
||||||
|
|
||||||
63
python-ruamel-yaml-pathlib.patch
Normal file
63
python-ruamel-yaml-pathlib.patch
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
diff --git a/_doc/conf.py b/_doc/conf.py
|
||||||
|
--- a/_doc/conf.py
|
||||||
|
+++ b/_doc/conf.py
|
||||||
|
@@ -75,7 +75,10 @@
|
||||||
|
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'):
|
||||||
|
diff --git a/_test/roundtrip.py b/_test/roundtrip.py
|
||||||
|
--- a/_test/roundtrip.py
|
||||||
|
+++ b/_test/roundtrip.py
|
||||||
|
@@ -7,7 +7,11 @@
|
||||||
|
"""
|
||||||
|
import sys
|
||||||
|
import textwrap
|
||||||
|
-from ruamel.std.pathlib import Path
|
||||||
|
+try:
|
||||||
|
+ from pathlib import Path
|
||||||
|
+except ImportError:
|
||||||
|
+ from pathlib2 import Path
|
||||||
|
+
|
||||||
|
|
||||||
|
enforce = object()
|
||||||
|
|
||||||
|
diff --git a/_test/test_api_change.py b/_test/test_api_change.py
|
||||||
|
--- a/_test/test_api_change.py
|
||||||
|
+++ b/_test/test_api_change.py
|
||||||
|
@@ -9,7 +9,10 @@
|
||||||
|
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:
|
||||||
|
diff --git a/_test/test_z_data.py b/_test/test_z_data.py
|
||||||
|
--- a/_test/test_z_data.py
|
||||||
|
+++ b/_test/test_z_data.py
|
||||||
|
@@ -6,7 +6,11 @@
|
||||||
|
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
|
||||||
|
|
||||||
18
python-ruamel-yaml-pytest27.patch
Normal file
18
python-ruamel-yaml-pytest27.patch
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
diff -u ruamel-yaml-ff02b83b8f91/_test/test_anchor.py.pytest27 ruamel-yaml-ff02b83b8f91/_test/test_anchor.py
|
||||||
|
--- ruamel-yaml-ff02b83b8f91/_test/test_anchor.py.pytest27 2019-08-27 10:59:01.756747586 +0100
|
||||||
|
+++ ruamel-yaml-ff02b83b8f91/_test/test_anchor.py 2019-08-27 11:00:15.929713043 +0100
|
||||||
|
@@ -7,6 +7,7 @@
|
||||||
|
"""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
+from distutils.version import LooseVersion
|
||||||
|
from textwrap import dedent
|
||||||
|
import platform
|
||||||
|
|
||||||
|
@@ -248,6 +249,7 @@
|
||||||
|
)
|
||||||
|
|
||||||
|
# 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
|
||||||
@ -1,100 +1,59 @@
|
|||||||
%global _empty_manifest_terminate_build 0
|
%global pypi_name ruamel.yaml
|
||||||
Name: python-ruamel-yaml
|
%global pname ruamel-yaml
|
||||||
Version: 0.18.6
|
%global commit ff02b83b8f91
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
|
Name: python-%{pname}
|
||||||
|
Version: 0.16.5
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
|
Summary: YAML 1.2 loader/dumper package for Python
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree
|
URL: https://bitbucket.org/ruamel/yaml
|
||||||
Source0: https://files.pythonhosted.org/packages/29/81/4dfc17eb6ebb1aac314a3eb863c1325b907863a1b8b1382cdffcb6ac0ed9/ruamel.yaml-0.18.6.tar.gz
|
Source0: https://bitbucket.org/ruamel/yaml/get/%{version}.tar.gz#/%{pname}-%{version}.tar.gz
|
||||||
BuildArch: noarch
|
|
||||||
Patch0001: 0000-fix-big-endian-issues.patch
|
Patch0001: python-ruamel-yaml-pytest27.patch
|
||||||
|
Patch0002: python-ruamel-yaml-pathlib.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
ruamel.yaml ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
||||||
|
It is a derivative of Kirill Simonov’s PyYAML 3.11
|
||||||
|
|
||||||
%package -n python3-ruamel-yaml
|
%package -n python3-%{pname}
|
||||||
Summary: ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
|
Summary: YAML 1.2 loader/dumper package for Python
|
||||||
Provides: python-ruamel-yaml = %{version}-%{release}
|
BuildRequires: python3-devel, python3-setuptools, python3-pytest
|
||||||
# Base build requires
|
|
||||||
BuildRequires: python3-devel
|
|
||||||
BuildRequires: python3-setuptools
|
|
||||||
BuildRequires: python3-pytest
|
|
||||||
BuildRequires: python3-pbr
|
|
||||||
BuildRequires: python3-pip
|
|
||||||
BuildRequires: python3-wheel
|
|
||||||
BuildRequires: python3-ruamel-yaml-clib
|
BuildRequires: python3-ruamel-yaml-clib
|
||||||
|
%{?python_provide:%python_provide python3-%{pypi_name}}
|
||||||
|
Requires: python3-ruamel-yaml-clib, python3-setuptools
|
||||||
|
|
||||||
%description -n python3-ruamel-yaml
|
%description -n python3-%{pname}
|
||||||
ruamel.yaml ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
||||||
|
It is a derivative of Kirill Simonov’s PyYAML 3.11
|
||||||
|
|
||||||
%package help
|
%package_help
|
||||||
Summary: ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
|
|
||||||
Provides: python3-ruamel-yaml-doc
|
|
||||||
%description help
|
|
||||||
ruamel.yaml ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n ruamel.yaml-%{version} -p1
|
%autosetup -n %{pname}-%{commit} -p1
|
||||||
|
rm -rf %{pypi_name}.egg-info
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export RUAMEL_NO_PIP_INSTALL_CHECK=1
|
%{__python3} setup.py install --single-version-externally-managed --skip-build --root $RPM_BUILD_ROOT
|
||||||
%py3_install
|
|
||||||
|
|
||||||
install -d -m755 %{buildroot}/%{_pkgdocdir}
|
%check
|
||||||
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
|
PYTHONPATH=$(echo build/lib) py.test-%{python3_version} _test/test_*.py
|
||||||
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
|
|
||||||
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
|
|
||||||
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
|
|
||||||
pushd %{buildroot}
|
|
||||||
if [ -d usr/lib ]; then
|
|
||||||
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
|
|
||||||
fi
|
|
||||||
if [ -d usr/lib64 ]; then
|
|
||||||
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
|
|
||||||
fi
|
|
||||||
if [ -d usr/bin ]; then
|
|
||||||
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
|
|
||||||
fi
|
|
||||||
if [ -d usr/sbin ]; then
|
|
||||||
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
|
|
||||||
fi
|
|
||||||
touch doclist.lst
|
|
||||||
if [ -d usr/share/man ]; then
|
|
||||||
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
mv %{buildroot}/filelist.lst .
|
|
||||||
mv %{buildroot}/doclist.lst .
|
|
||||||
|
|
||||||
##Tests are not included in the upstream tarball
|
%files -n python3-%{pname}
|
||||||
#%check
|
%license LICENSE
|
||||||
#PYTHONPATH=$(echo build/lib) py.test-%{python3_version} _test/test_*.py
|
%{python3_sitelib}/ruamel
|
||||||
|
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?-*.pth
|
||||||
%files -n python3-ruamel-yaml -f filelist.lst
|
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
||||||
%dir %{python3_sitelib}/*
|
|
||||||
|
|
||||||
%files help
|
%files help
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc README.md CHANGES
|
%doc README.rst
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Mar 15 2024 jiangxinyu <jiangxinyu@kylinos.cn> - 0.18.6-1
|
|
||||||
- Update package to version 0.18.6
|
|
||||||
- Fix issue with multiple document intermixing YAML 1.2 and YAML 1.1, the VersionedResolver now resets
|
|
||||||
|
|
||||||
* Fri Jul 14 2023 chenzixuan <chenzixuan@kylinos.cn> - 0.17.32-1
|
|
||||||
- Upgrade python3-ruamel-yaml to version 0.17.32
|
|
||||||
|
|
||||||
* Sat Jun 04 2022 OpenStack_SIG <openstack@openeuler.org> - 0.17.21-1
|
|
||||||
- Upgrade python3-ruamel-yaml to version 0.17.21
|
|
||||||
|
|
||||||
* Fri May 20 2022 yaoxin <yaoxin30@h-partners.com> - 0.17.20-1
|
|
||||||
- Update to 0.17.20
|
|
||||||
|
|
||||||
*Tue Mar 29 2022 xu_ping <xuping33@huawei.com> - 0.16.5-2
|
|
||||||
- Fix testcase test_anchor and test_deprecation error
|
|
||||||
|
|
||||||
* Mon Mar 2 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.16.5-1
|
* Mon Mar 2 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.16.5-1
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
BIN
ruamel-yaml-0.16.5.tar.gz
Normal file
BIN
ruamel-yaml-0.16.5.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user