From d55e400379f67d4cb2baaf8befb2c0ec8a24fe72 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 26 May 2018 19:57:41 -0400 Subject: [PATCH] Better handling of wheels / update requirementslib Signed-off-by: Dan Ryan --- pipenv/patched/notpip/_internal/pep425tags.py | 7 ++----- pipenv/vendor/requirementslib/__init__.py | 2 +- pipenv/vendor/requirementslib/requirements.py | 7 +++++-- .../patched/_post-pip-update-pep425tags.patch | 21 +++++++++++++------ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/pipenv/patched/notpip/_internal/pep425tags.py b/pipenv/patched/notpip/_internal/pep425tags.py index bea3158598..4205f6e0ba 100644 --- a/pipenv/patched/notpip/_internal/pep425tags.py +++ b/pipenv/patched/notpip/_internal/pep425tags.py @@ -10,10 +10,7 @@ import warnings from collections import OrderedDict -try: - import pip._internal.utils.glibc -except ImportError: - import pip.utils.glibc +import pipenv.patched.notpip._internal.utils.glibc logger = logging.getLogger(__name__) @@ -157,7 +154,7 @@ def is_manylinux1_compatible(): pass # Check glibc version. CentOS 5 uses glibc 2.5. - return pip._internal.utils.glibc.have_compatible_glibc(2, 5) + return pipenv.patched.notpip._internal.utils.glibc.have_compatible_glibc(2, 5) def get_darwin_arches(major, minor, machine): diff --git a/pipenv/vendor/requirementslib/__init__.py b/pipenv/vendor/requirementslib/__init__.py index 6727a81e2f..11e096755e 100644 --- a/pipenv/vendor/requirementslib/__init__.py +++ b/pipenv/vendor/requirementslib/__init__.py @@ -1,4 +1,4 @@ # -*- coding=utf-8 -*- -__version__ = "0.0.6" +__version__ = "0.0.7.dev0" from .requirements import Requirement diff --git a/pipenv/vendor/requirementslib/requirements.py b/pipenv/vendor/requirementslib/requirements.py index e5989474d7..4b167ca885 100644 --- a/pipenv/vendor/requirementslib/requirements.py +++ b/pipenv/vendor/requirementslib/requirements.py @@ -8,7 +8,7 @@ import six from attr import attrs, attrib, Factory, validators import attr -from ._compat import Link, path_to_url, _strip_extras, InstallRequirement +from ._compat import Link, path_to_url, _strip_extras, InstallRequirement, Wheel from distlib.markers import Evaluator from packaging.markers import Marker, InvalidMarker from packaging.specifiers import SpecifierSet, InvalidSpecifier @@ -306,7 +306,10 @@ def get_name(self): @link.default def get_link(self): target = "{0}#egg={1}".format(self.uri, self.name) - return Link(target) + link = Link(target) + if link.is_wheel and self._has_hashed_name: + self.name = os.path.basename(Wheel(link.path).name) + return link @req.default def get_requirement(self): diff --git a/tasks/vendoring/patches/patched/_post-pip-update-pep425tags.patch b/tasks/vendoring/patches/patched/_post-pip-update-pep425tags.patch index 70ccd170f0..ebebe17eaa 100644 --- a/tasks/vendoring/patches/patched/_post-pip-update-pep425tags.patch +++ b/tasks/vendoring/patches/patched/_post-pip-update-pep425tags.patch @@ -1,16 +1,25 @@ diff --git a/pipenv/patched/notpip/_internal/pep425tags.py b/pipenv/patched/notpip/_internal/pep425tags.py -index bea31585..9e9609f3 100644 +index bea31585..4205f6e0 100644 --- a/pipenv/patched/notpip/_internal/pep425tags.py +++ b/pipenv/patched/notpip/_internal/pep425tags.py -@@ -11,9 +11,9 @@ import warnings +@@ -10,10 +10,7 @@ import sysconfig + import warnings from collections import OrderedDict - try: +-try: - import pip._internal.utils.glibc -+ import pipenv.patched.notpip._internal.utils.glibc - except ImportError: +-except ImportError: - import pip.utils.glibc -+ import pipenv.patched.notpip.utils.glibc ++import pipenv.patched.notpip._internal.utils.glibc logger = logging.getLogger(__name__) +@@ -157,7 +154,7 @@ def is_manylinux1_compatible(): + pass + + # Check glibc version. CentOS 5 uses glibc 2.5. +- return pip._internal.utils.glibc.have_compatible_glibc(2, 5) ++ return pipenv.patched.notpip._internal.utils.glibc.have_compatible_glibc(2, 5) + + + def get_darwin_arches(major, minor, machine):