Skip to content

Commit

Permalink
Better handling of wheels / update requirementslib
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <dan@danryan.co>
  • Loading branch information
techalchemy committed May 26, 2018
1 parent 513bdfb commit d55e400
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
7 changes: 2 additions & 5 deletions pipenv/patched/notpip/_internal/pep425tags.py
Expand Up @@ -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__)

Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion 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
7 changes: 5 additions & 2 deletions pipenv/vendor/requirementslib/requirements.py
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
21 changes: 15 additions & 6 deletions 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):

0 comments on commit d55e400

Please sign in to comment.