!5 Update to 0.17.20
From: @starlet-dx Reviewed-by: @myeuler Signed-off-by: @myeuler
This commit is contained in:
commit
aaddc23124
33
0000-fix-big-endian-issues.patch
Normal file
33
0000-fix-big-endian-issues.patch
Normal file
@ -0,0 +1,33 @@
|
||||
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!
|
||||
|
||||
Index: ruamel.yaml/main.py
|
||||
===================================================================
|
||||
--- ruamel.yaml.orig/main.py 2021-10-14 00:10:27.265523204 +0200
|
||||
+++ ruamel.yaml/main.py 2021-10-14 00:11:02.469504291 +0200
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
|
||||
class YAML:
|
||||
- def __init__(self, *, typ=None, pure=False, output=None, plug_ins=None): # input=None,
|
||||
+ def __init__(self, *, typ=None, pure=None, output=None, plug_ins=None): # input=None,
|
||||
# type: (Any, Optional[Text], Any, Any, Any) -> None
|
||||
"""
|
||||
typ: 'rt'/None -> RoundTripLoader/RoundTripDumper, (default)
|
||||
@@ -64,6 +64,11 @@
|
||||
"""
|
||||
|
||||
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
|
||||
@ -1,14 +0,0 @@
|
||||
diff --git a/_test/test_deprecation.py b/_test/test_deprecation.py
|
||||
index 35cb095..14acd71 100644
|
||||
--- a/_test/test_deprecation.py
|
||||
+++ b/_test/test_deprecation.py
|
||||
@@ -6,7 +6,8 @@ import sys
|
||||
import pytest # NOQA
|
||||
|
||||
|
||||
-@pytest.mark.skipif(sys.version_info < (3, 7), reason='collections not available?')
|
||||
+@pytest.mark.skipif(sys.version_info < (3, 7) or sys.version_info >= (3, 9),
|
||||
+ reason='collections not available?')
|
||||
def test_collections_deprecation():
|
||||
with pytest.warns(DeprecationWarning):
|
||||
from collections import Hashable # NOQA
|
||||
@ -1,63 +0,0 @@
|
||||
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
|
||||
|
||||
@ -1,18 +1,16 @@
|
||||
%global pypi_name ruamel.yaml
|
||||
%global pname ruamel-yaml
|
||||
%global commit ff02b83b8f91
|
||||
%global debug_package %{nil}
|
||||
|
||||
Name: python-%{pname}
|
||||
Version: 0.16.5
|
||||
Release: 2
|
||||
Version: 0.17.20
|
||||
Release: 1
|
||||
Summary: YAML 1.2 loader/dumper package for Python
|
||||
License: MIT
|
||||
URL: https://bitbucket.org/ruamel/yaml
|
||||
Source0: https://bitbucket.org/ruamel/yaml/get/%{version}.tar.gz#/%{pname}-%{version}.tar.gz
|
||||
Source0: https://files.pythonhosted.org/packages/source/r/ruamel.yaml/ruamel.yaml-%{version}.tar.gz
|
||||
|
||||
Patch0001: python-ruamel-yaml-pathlib.patch
|
||||
Patch0002: Fix-testcase-error-due-to-distutils-package-is-deprecated.patch
|
||||
Patch0001: 0000-fix-big-endian-issues.patch
|
||||
|
||||
%description
|
||||
ruamel.yaml is a YAML 1.2 loader/dumper package for Python.
|
||||
@ -32,8 +30,8 @@ It is a derivative of Kirill Simonov’s PyYAML 3.11
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%autosetup -n %{pname}-%{commit} -p1
|
||||
rm -rf %{pypi_name}.egg-info
|
||||
%autosetup -n %{pypi_name}-%{version} -p1
|
||||
rm -rf *.egg-info
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
@ -41,8 +39,9 @@ rm -rf %{pypi_name}.egg-info
|
||||
%install
|
||||
%{__python3} setup.py install --single-version-externally-managed --skip-build --root $RPM_BUILD_ROOT
|
||||
|
||||
%check
|
||||
PYTHONPATH=$(echo build/lib) py.test-%{python3_version} _test/test_*.py
|
||||
##Tests are not included in the upstream tarball
|
||||
#%check
|
||||
#PYTHONPATH=$(echo build/lib) py.test-%{python3_version} _test/test_*.py
|
||||
|
||||
%files -n python3-%{pname}
|
||||
%license LICENSE
|
||||
@ -52,9 +51,12 @@ PYTHONPATH=$(echo build/lib) py.test-%{python3_version} _test/test_*.py
|
||||
|
||||
%files help
|
||||
%defattr(-,root,root)
|
||||
%doc README.rst
|
||||
%doc README.rst CHANGES
|
||||
|
||||
%changelog
|
||||
* 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
|
||||
|
||||
|
||||
Binary file not shown.
BIN
ruamel.yaml-0.17.20.tar.gz
Normal file
BIN
ruamel.yaml-0.17.20.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user