Fake upgrade to requirementslib 1.0.5

This commit is contained in:
Tzu-ping Chung
2018-06-24 15:54:07 +08:00
parent 1afee9a118
commit f91d83983c
2 changed files with 16 additions and 10 deletions
+15 -9
View File
@@ -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):
+1 -1
View File
@@ -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