commit
aad89caad2
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
|
||||
59
python-ruamel-yaml.spec
Normal file
59
python-ruamel-yaml.spec
Normal file
@ -0,0 +1,59 @@
|
||||
%global pypi_name ruamel.yaml
|
||||
%global pname ruamel-yaml
|
||||
%global commit ff02b83b8f91
|
||||
%global debug_package %{nil}
|
||||
|
||||
Name: python-%{pname}
|
||||
Version: 0.16.5
|
||||
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
|
||||
|
||||
Patch0001: python-ruamel-yaml-pytest27.patch
|
||||
Patch0002: python-ruamel-yaml-pathlib.patch
|
||||
|
||||
%description
|
||||
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-%{pname}
|
||||
Summary: YAML 1.2 loader/dumper package for Python
|
||||
BuildRequires: python3-devel, python3-setuptools, python3-pytest
|
||||
BuildRequires: python3-ruamel-yaml-clib
|
||||
%{?python_provide:%python_provide python3-%{pypi_name}}
|
||||
Requires: python3-ruamel-yaml-clib, python3-setuptools
|
||||
|
||||
%description -n python3-%{pname}
|
||||
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
|
||||
|
||||
%prep
|
||||
%autosetup -n %{pname}-%{commit} -p1
|
||||
rm -rf %{pypi_name}.egg-info
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
|
||||
%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
|
||||
|
||||
%files -n python3-%{pname}
|
||||
%license LICENSE
|
||||
%{python3_sitelib}/ruamel
|
||||
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?-*.pth
|
||||
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
|
||||
|
||||
%files help
|
||||
%defattr(-,root,root)
|
||||
%doc README.rst
|
||||
|
||||
%changelog
|
||||
* Mon Mar 2 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.16.5-1
|
||||
- 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.
Loading…
x
Reference in New Issue
Block a user