From 8502ac96ece321f75b2c10e641d8d2ffba9c9089 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 12 Nov 2018 12:04:58 -0500 Subject: [PATCH] Revendor Signed-off-by: Dan Ryan --- pipenv/vendor/pythonfinder/models/path.py | 1 - pipenv/vendor/pythonfinder/pythonfinder.py | 4 ++-- pipenv/vendor/pythonfinder/utils.py | 2 +- pipenv/vendor/requirementslib/models/lockfile.py | 4 ++-- .../vendor/requirementslib/models/requirements.py | 15 +++++---------- pipenv/vendor/requirementslib/models/utils.py | 1 - pipenv/vendor/vendor.txt | 6 +++--- 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/pipenv/vendor/pythonfinder/models/path.py b/pipenv/vendor/pythonfinder/models/path.py index 33b4ab58..3d01e7cf 100644 --- a/pipenv/vendor/pythonfinder/models/path.py +++ b/pipenv/vendor/pythonfinder/models/path.py @@ -448,7 +448,6 @@ class PathEntry(BasePath): if self.is_dir: return None if self.is_python: - from .python import PythonVersion try: py_version = PythonVersion.from_path(path=self, name=self.name) except InvalidPythonVersion: diff --git a/pipenv/vendor/pythonfinder/pythonfinder.py b/pipenv/vendor/pythonfinder/pythonfinder.py index 854cc8e7..b3bad570 100644 --- a/pipenv/vendor/pythonfinder/pythonfinder.py +++ b/pipenv/vendor/pythonfinder/pythonfinder.py @@ -65,7 +65,7 @@ class Finder(object): def which(self, exe): return self.system_path.which(exe) - @lru_cache(maxsize=128) + @lru_cache(maxsize=1024) def find_python_version( self, major=None, minor=None, patch=None, pre=None, dev=None, arch=None, name=None ): @@ -113,7 +113,7 @@ class Finder(object): major=major, minor=minor, patch=patch, pre=pre, dev=dev, arch=arch, name=name ) - @lru_cache(maxsize=128) + @lru_cache(maxsize=1024) def find_all_python_versions( self, major=None, minor=None, patch=None, pre=None, dev=None, arch=None, name=None ): diff --git a/pipenv/vendor/pythonfinder/utils.py b/pipenv/vendor/pythonfinder/utils.py index ca07b42f..42a63e54 100644 --- a/pipenv/vendor/pythonfinder/utils.py +++ b/pipenv/vendor/pythonfinder/utils.py @@ -90,7 +90,7 @@ def looks_like_python(name): return any(fnmatch(name, rule) for rule in MATCH_RULES) -@lru_cache(maxsize=128) +@lru_cache(maxsize=1024) def path_is_python(path): return path_is_executable(path) and looks_like_python(path.name) diff --git a/pipenv/vendor/requirementslib/models/lockfile.py b/pipenv/vendor/requirementslib/models/lockfile.py index 6f61f57e..9d19edaf 100644 --- a/pipenv/vendor/requirementslib/models/lockfile.py +++ b/pipenv/vendor/requirementslib/models/lockfile.py @@ -223,13 +223,13 @@ class Lockfile(object): try: projectfile = cls.load_projectfile(path, create=create) - except JSONDecodeError as e: + except JSONDecodeError: path = os.path.abspath(path) if not os.path.isdir(path): path = os.path.dirname(path) path = Path(os.path.join(path, "Pipfile.lock")) formatted_path = path.as_posix() - backup_path = "%.bak" % formatted_path + backup_path = "%s.bak" % formatted_path LockfileCorruptException.show(formatted_path, backup_path=backup_path) path.rename(backup_path) cls.load(formatted_path, create=True) diff --git a/pipenv/vendor/requirementslib/models/requirements.py b/pipenv/vendor/requirementslib/models/requirements.py index aafb059b..d5330b48 100644 --- a/pipenv/vendor/requirementslib/models/requirements.py +++ b/pipenv/vendor/requirementslib/models/requirements.py @@ -14,7 +14,7 @@ import pip_shims from first import first from packaging.markers import Marker from packaging.requirements import Requirement as PackagingRequirement -from packaging.specifiers import Specifier, SpecifierSet +from packaging.specifiers import Specifier, SpecifierSet, LegacySpecifier, InvalidSpecifier from packaging.utils import canonicalize_name from six.moves.urllib import parse as urllib_parse from six.moves.urllib.parse import unquote @@ -325,9 +325,6 @@ class FileRequirement(object): if setup_name: name = setup_name self._has_hashed_name = False - version = setupinfo_dict.get("version") - if version and not self.version: - self.version = version build_requires = setupinfo_dict.get("build_requires") build_backend = setupinfo_dict.get("build_backend") if build_requires and not self.pyproject_requires: @@ -404,7 +401,6 @@ class FileRequirement(object): cls, path=None, uri=None, editable=False, extras=None, link=None, vcs_type=None, name=None, req=None, line=None, uri_scheme=None, setup_path=None, relpath=None ): - import pip_shims.shims if relpath and not path: path = relpath if not path and uri and link.scheme == "file": @@ -455,7 +451,6 @@ class FileRequirement(object): creation_kwargs["vcs_type"] = vcs_type _line = None if not name: - import pip_shims.shims _line = unquote(link.url_without_fragment) if link.url else uri if editable: ireq = pip_shims.shims.install_req_from_editable(_line) @@ -1050,8 +1045,6 @@ class Requirement(object): @classmethod def from_line(cls, line): - import pip_shims.shims - if isinstance(line, pip_shims.shims.InstallRequirement): line = format_requirement(line) hashes = None @@ -1200,7 +1193,6 @@ class Requirement(object): old_name = cls_inst.req.req.name or cls_inst.req.name if not cls_inst.is_named and not cls_inst.editable and not name: if cls_inst.is_vcs: - import pip_shims.shims ireq = pip_shims.shims.install_req_from_req(cls_inst.as_line(include_hashes=False)) info = SetupInfo.from_ireq(ireq) if info is not None: @@ -1276,7 +1268,10 @@ class Requirement(object): return markers def get_specifier(self): - return Specifier(self.specifiers) + try: + return Specifier(self.specifiers) + except InvalidSpecifier: + return LegacySpecifier(self.specifiers) def get_version(self): return pip_shims.shims.parse_version(self.get_specifier().version) diff --git a/pipenv/vendor/requirementslib/models/utils.py b/pipenv/vendor/requirementslib/models/utils.py index 2b47ee9b..0fac2aa3 100644 --- a/pipenv/vendor/requirementslib/models/utils.py +++ b/pipenv/vendor/requirementslib/models/utils.py @@ -95,7 +95,6 @@ def build_vcs_link(vcs, uri, name=None, ref=None, subdirectory=None, extras=None if extras: extras = extras_to_string(extras) uri = "{0}{1}".format(uri, extras) - # if subdirectory: if subdirectory: uri = "{0}&subdirectory={1}".format(uri, subdirectory) return create_link(uri) diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt index 45ff0384..c106a59c 100644 --- a/pipenv/vendor/vendor.txt +++ b/pipenv/vendor/vendor.txt @@ -21,20 +21,20 @@ pipdeptree==0.13.0 pipreqs==0.4.9 docopt==0.6.2 yarg==0.1.9 -pythonfinder==1.1.7 +pythonfinder==1.1.8 requests==2.20.0 chardet==3.0.4 idna==2.7 urllib3==1.24 certifi==2018.10.15 -requirementslib==1.2.5 +requirementslib==1.3.0 attrs==18.2.0 distlib==0.2.8 packaging==18.0 pyparsing==2.2.2 pytoml==0.1.19 plette==0.2.2 - tomlkit==0.4.6 + tomlkit==0.5.2 shellingham==1.2.7 six==1.11.0 semver==2.8.1