Blob Blame History Raw
From 39a70cce69d9b08cc4d02b225114d556d5b59ada Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <hugovk@users.noreply.github.com>
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",