From 97bb50d344d91df042a4d5c7c984e67b5a632cd8 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 18 Jun 2018 02:31:55 -0400 Subject: [PATCH 1/2] Add conversion methods for requires-python formats - Handle single-digit un-specified requires-python format - `Requires-Python: 3` should be functionally equivalent to `>=3,<4` - Fixes #2343 Signed-off-by: Dan Ryan --- pipenv/patched/piptools/repositories/pypi.py | 16 +++++++++-- .../vendoring/patches/patched/piptools.patch | 28 +++++++++++++------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/pipenv/patched/piptools/repositories/pypi.py b/pipenv/patched/piptools/repositories/pypi.py index 0702e73e3c..62ed490dc5 100644 --- a/pipenv/patched/piptools/repositories/pypi.py +++ b/pipenv/patched/piptools/repositories/pypi.py @@ -24,7 +24,7 @@ from pipenv.patched.notpip._vendor.packaging.requirements import InvalidRequirement, Requirement from pipenv.patched.notpip._vendor.packaging.version import Version, InvalidVersion, parse as parse_version -from pipenv.patched.notpip._vendor.packaging.specifiers import SpecifierSet +from pipenv.patched.notpip._vendor.packaging.specifiers import SpecifierSet, InvalidSpecifier from pipenv.patched.notpip._vendor.pyparsing import ParseException from ..cache import CACHE_DIR @@ -167,8 +167,18 @@ def find_best_match(self, ireq, prereleases=None): py_version = parse_version(os.environ.get('PIP_PYTHON_VERSION', str(sys.version_info[:3]))) all_candidates = [] for c in self.find_all_candidates(ireq.name): - if c.requires_python and not SpecifierSet(c.requires_python).contains(py_version): - continue + if c.requires_python: + # Old specifications had people setting this to single digits + # which is effectively the same as '>=digit,=digit,= 10 (new resolver!) -@@ -190,14 +312,64 @@ class PyPIRepository(BaseRepository): +@@ -190,14 +322,64 @@ class PyPIRepository(BaseRepository): upgrade_strategy="to-satisfy-only", force_reinstall=False, ignore_dependencies=False, @@ -311,7 +321,7 @@ index 1c4b943..ab5a56c 100644 reqset.cleanup_files() return set(self._dependencies_cache[ireq]) -@@ -224,17 +396,10 @@ class PyPIRepository(BaseRepository): +@@ -224,17 +406,10 @@ class PyPIRepository(BaseRepository): matching_candidates = candidates_by_version[matching_versions[0]] return { From 71ff85770e2891d1575496891b4013a437632c72 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 18 Jun 2018 11:45:07 -0400 Subject: [PATCH 2/2] Fix `isdigit` check and bump version to dev0 Signed-off-by: Dan Ryan --- pipenv/__version__.py | 2 +- pipenv/patched/piptools/repositories/pypi.py | 2 +- tasks/vendoring/patches/patched/piptools.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pipenv/__version__.py b/pipenv/__version__.py index 7f3fb86d64..c938b87aa2 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -2,4 +2,4 @@ # // ) ) / / // ) ) //___) ) // ) ) || / / # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / -__version__ = '2018.05.18' +__version__ = '2018.6.0.dev0' diff --git a/pipenv/patched/piptools/repositories/pypi.py b/pipenv/patched/piptools/repositories/pypi.py index 62ed490dc5..1c0db57170 100644 --- a/pipenv/patched/piptools/repositories/pypi.py +++ b/pipenv/patched/piptools/repositories/pypi.py @@ -170,7 +170,7 @@ def find_best_match(self, ireq, prereleases=None): if c.requires_python: # Old specifications had people setting this to single digits # which is effectively the same as '>=digit,=digit,