forked from pool/python-packaging
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=51
This commit is contained in:
parent
324aec8654
commit
eabfbf7c81
34
no-legacyversion-warning.patch
Normal file
34
no-legacyversion-warning.patch
Normal file
@ -0,0 +1,34 @@
|
||||
Index: packaging-21.2/packaging/specifiers.py
|
||||
===================================================================
|
||||
--- packaging-21.2.orig/packaging/specifiers.py
|
||||
+++ packaging-21.2/packaging/specifiers.py
|
||||
@@ -270,12 +270,6 @@ class LegacySpecifier(_IndividualSpecifi
|
||||
def __init__(self, spec: str = "", prereleases: Optional[bool] = None) -> None:
|
||||
super().__init__(spec, prereleases)
|
||||
|
||||
- warnings.warn(
|
||||
- "Creating a LegacyVersion has been deprecated and will be "
|
||||
- "removed in the next major release",
|
||||
- DeprecationWarning,
|
||||
- )
|
||||
-
|
||||
def _coerce_version(self, version: UnparsedVersion) -> LegacyVersion:
|
||||
if not isinstance(version, LegacyVersion):
|
||||
version = LegacyVersion(str(version))
|
||||
Index: packaging-21.2/packaging/version.py
|
||||
===================================================================
|
||||
--- packaging-21.2.orig/packaging/version.py
|
||||
+++ packaging-21.2/packaging/version.py
|
||||
@@ -108,12 +108,6 @@ class LegacyVersion(_BaseVersion):
|
||||
self._version = str(version)
|
||||
self._key = _legacy_cmpkey(self._version)
|
||||
|
||||
- warnings.warn(
|
||||
- "Creating a LegacyVersion has been deprecated and will be "
|
||||
- "removed in the next major release",
|
||||
- DeprecationWarning,
|
||||
- )
|
||||
-
|
||||
def __str__(self) -> str:
|
||||
return self._version
|
||||
|
@ -16,7 +16,6 @@ Sat Nov 6 18:30:50 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||
* Use typing alias ``UnparsedVersion``
|
||||
* Improve type inference for ``packaging.specifiers.filter()``
|
||||
* Tighten the return type of ``canonicalize_version()``
|
||||
- drop no-legacyversion-warning.patch: setuptools has been updated
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 17 17:28:43 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||
|
@ -34,6 +34,8 @@ Summary: Core utilities for Python packages
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/pypa/packaging
|
||||
Source: https://files.pythonhosted.org/packages/source/p/packaging/packaging-%{version}.tar.gz
|
||||
# Restore compatibility with 20.4 for setuptools
|
||||
Patch1: no-legacyversion-warning.patch
|
||||
BuildRequires: %{python_module six}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
@ -61,7 +63,7 @@ Provides: %{mypython}3dist(packaging) = %{version}-%{release}
|
||||
Core utilities for Python packages
|
||||
|
||||
%prep
|
||||
%setup -q -n packaging-%{version}
|
||||
%autosetup -p1 -n packaging-%{version}
|
||||
# sdist must provide a packaging.egg-info, used below in install phase
|
||||
test -d packaging.egg-info
|
||||
|
||||
@ -70,7 +72,8 @@ test -d packaging.egg-info
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
%pytest
|
||||
# no-legacyversion-warning.patch causes these to fail
|
||||
%pytest -k "not (test_legacy_specifier_is_deprecated or test_legacy_version_is_deprecated)"
|
||||
|
||||
%endif # %%{with_test}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user