From 2a2fb373ad9beda349758f82822af5559928eb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 2 Oct 2020 11:44:11 +0200 Subject: [PATCH] Drop the dependency on six to make the package lighter --- 39a70cce.patch | 51 +++++++++++++++++++++++++++++++++++++++++++ python-packaging.spec | 12 ++++++---- 2 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 39a70cce.patch diff --git a/39a70cce.patch b/39a70cce.patch new file mode 100644 index 0000000..ed49176 --- /dev/null +++ b/39a70cce.patch @@ -0,0 +1,51 @@ +From 39a70cce69d9b08cc4d02b225114d556d5b59ada Mon Sep 17 00:00:00 2001 +From: Hugo van Kemenade +Date: Wed, 19 Aug 2020 22:37:34 +0300 +Subject: [PATCH] Remove dependency on six to make package lighter (#331) + +--- + packaging/requirements.py | 8 +++++++- + setup.py | 2 +- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/packaging/requirements.py b/packaging/requirements.py +index 91f81ed..2226e98 100644 +--- a/packaging/requirements.py ++++ b/packaging/requirements.py +@@ -5,16 +5,22 @@ + + import string + import re ++import sys + + from pyparsing import stringStart, stringEnd, originalTextFor, ParseException + from pyparsing import ZeroOrMore, Word, Optional, Regex, Combine + from pyparsing import Literal as L # noqa +-from six.moves.urllib import parse as urlparse + + from ._typing import TYPE_CHECKING + from .markers import MARKER_EXPR, Marker + from .specifiers import LegacySpecifier, Specifier, SpecifierSet + ++if sys.version_info[0] >= 3: ++ from urllib import parse as urlparse # pragma: no cover ++else: # pragma: no cover ++ import urlparse ++ ++ + if TYPE_CHECKING: # pragma: no cover + from typing import List + +diff --git a/setup.py b/setup.py +index f533a7d..a14d926 100644 +--- a/setup.py ++++ b/setup.py +@@ -49,7 +49,7 @@ + author=about["__author__"], + author_email=about["__email__"], + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", +- install_requires=["pyparsing>=2.0.2", "six"], # Needed to avoid issue #91 ++ install_requires=["pyparsing>=2.0.2"], # Needed to avoid issue #91 + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", diff --git a/python-packaging.spec b/python-packaging.spec index 2ddbbc5..fc5f37f 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -13,7 +13,7 @@ Name: python-%{pypi_name} Version: 20.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Core utilities for Python packages License: BSD or ASL 2.0 @@ -21,10 +21,12 @@ URL: https://github.com/pypa/packaging Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch +# Remove dependency on six to make package lighter, backported from upstream +Patch1: %{url}/commit/39a70cce.patch + BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-pyparsing -BuildRequires: python%{python3_pkgversion}-six %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pretend @@ -47,7 +49,6 @@ Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} Requires: python%{python3_pkgversion}-pyparsing -Requires: python%{python3_pkgversion}-six %description -n python%{python3_pkgversion}-%{pypi_name} python3-packaging provides core utilities for Python packages like utilities for @@ -62,7 +63,7 @@ Documentation for python-packaging %endif %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -p1 -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info @@ -111,6 +112,9 @@ tests/ %endif %changelog +* Fri Oct 02 2020 Miro HronĨok - 20.4-3 +- Drop the dependency on six to make the package lighter + * Wed Jul 29 2020 Fedora Release Engineering - 20.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild