diff --git a/Fix-testcase-error-due-to-distutils-package-is-deprecated.patch b/Fix-testcase-error-due-to-distutils-package-is-deprecated.patch new file mode 100644 index 0000000..94ad035 --- /dev/null +++ b/Fix-testcase-error-due-to-distutils-package-is-deprecated.patch @@ -0,0 +1,14 @@ +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 diff --git a/python-ruamel-yaml-pytest27.patch b/python-ruamel-yaml-pytest27.patch deleted file mode 100644 index 9ef3da0..0000000 --- a/python-ruamel-yaml-pytest27.patch +++ /dev/null @@ -1,18 +0,0 @@ -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 diff --git a/python-ruamel-yaml.spec b/python-ruamel-yaml.spec index 328b3dd..18f241d 100644 --- a/python-ruamel-yaml.spec +++ b/python-ruamel-yaml.spec @@ -5,14 +5,14 @@ Name: python-%{pname} Version: 0.16.5 -Release: 1 +Release: 2 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 +Patch0001: python-ruamel-yaml-pathlib.patch +Patch0002: Fix-testcase-error-due-to-distutils-package-is-deprecated.patch %description ruamel.yaml is a YAML 1.2 loader/dumper package for Python. @@ -47,13 +47,16 @@ 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 +%{python3_sitelib}/%{pypi_name}-%{version}-py*.pth +%{python3_sitelib}/%{pypi_name}-%{version}-py*.egg-info %files help %defattr(-,root,root) %doc README.rst %changelog +*Tue Mar 29 2022 xu_ping - 0.16.5-2 +- Fix testcase test_anchor and test_deprecation error + * Mon Mar 2 2020 openEuler Buildteam - 0.16.5-1 - Package init