From f91d83983cd2765d88c98e97ad5b5900c84e56ab Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Sun, 24 Jun 2018 15:54:07 +0800 Subject: [PATCH] Fake upgrade to requirementslib 1.0.5 --- pipenv/vendor/requirementslib/utils.py | 24 +++++++++++++++--------- pipenv/vendor/vendor.txt | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/pipenv/vendor/requirementslib/utils.py b/pipenv/vendor/requirementslib/utils.py index 02511c93..4204d73a 100644 --- a/pipenv/vendor/requirementslib/utils.py +++ b/pipenv/vendor/requirementslib/utils.py @@ -2,6 +2,7 @@ from __future__ import absolute_import import logging import os +import posixpath import six from itertools import product @@ -60,20 +61,25 @@ def is_vcs(pipfile_entry): def get_converted_relative_path(path, relative_to=os.curdir): - """Given a vague relative path, return the path relative to the given location""" + """Convert `path` to be relative. + + Given a vague relative path, return the path relative to the given + location. + + This performs additional conversion to ensure the result is of POSIX form, + and starts with `./`, or is precisely `.`. + """ start = Path(relative_to) try: start = start.resolve() except OSError: start = start.absolute() - path = start.joinpath(".", path).relative_to(start) - # Normalize these to use forward slashes even on windows - if os.name == "nt": - relpath = os.altsep.join([".", path.as_posix()]) - relpath = os.sep.join([".", path.as_posix()]) - if relpath in ['./.', '.\\.']: - relpath = '.' - return relpath + path = start.joinpath(path).relative_to(start) + + relpath_s = posixpath.normpath(path.as_posix()) + if not (relpath_s == "." or relpath_s.startswith("./")): + relpath_s = posixpath.join(".", relpath_s) + return relpath_s def multi_split(s, split): diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt index aa1e3126..6b44b53d 100644 --- a/pipenv/vendor/vendor.txt +++ b/pipenv/vendor/vendor.txt @@ -27,7 +27,7 @@ requests==2.19.1 idna==2.7 urllib3==1.23 certifi==2018.4.16 -requirementslib==1.0.4 +requirementslib==1.0.5 attrs==18.1.0 distlib==0.2.7 packaging==17.1