Update requirementslib

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-06-22 22:18:26 -04:00
parent 37ba557110
commit cc8984b447
5 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding=utf-8 -*-
__version__ = "1.0.1"
__version__ = "1.0.2"
from .exceptions import RequirementError
+4 -3
View File
@@ -9,8 +9,8 @@ from .._compat import Path, FileNotFoundError
@attr.s
class Lockfile(object):
dev_requirements = attr.ib(default=list)
requirements = attr.ib(default=list)
dev_requirements = attr.ib(default=attr.Factory(list))
requirements = attr.ib(default=attr.Factory(list))
path = attr.ib(default=None, validator=optional_instance_of(Path))
pipfile_hash = attr.ib(default=None)
@@ -31,7 +31,8 @@ class Lockfile(object):
if not lockfile_path.exists():
raise FileNotFoundError("No such lockfile: %s" % lockfile_path)
lockfile = json.loads(lockfile_path.read_text(encoding="utf-8"))
with lockfile_path.open(encoding="utf-8") as f:
lockfile = json.loads(f.read())
for k in lockfile["develop"].keys():
dev_requirements.append(Requirement.from_pipfile(k, lockfile["develop"][k]))
for k in lockfile["default"].keys():
+6 -1
View File
@@ -324,7 +324,7 @@ class FileRequirement(BaseRequirement):
vcs_type, prefer, relpath, path, uri, link = cls.get_link_from_line(line)
setup_path = Path(path) / "setup.py" if path else None
arg_dict = {
"path": relpath or path,
"path": relpath if relpath else path,
"uri": unquote(link.url_without_fragment),
"link": link,
"editable": editable,
@@ -347,6 +347,11 @@ class FileRequirement(BaseRequirement):
uri = pipfile.get("uri")
fil = pipfile.get("file")
path = pipfile.get("path")
if path:
if isinstance(path, Path) and not path.is_absolute():
path = get_converted_relative_path(path.as_posix())
elif not os.path.isabs(path):
path = get_converted_relative_path(path)
if path and uri:
raise ValueError("do not specify both 'path' and 'uri'")
if path and fil:
+1 -1
View File
@@ -84,7 +84,7 @@ def strip_ssh_from_git_uri(uri):
def add_ssh_scheme_to_git_uri(uri):
"""Cleans VCS uris from pipenv.patched.notpip format"""
"""Cleans VCS uris from pip format"""
if isinstance(uri, six.string_types):
# Add scheme for parsing purposes, this is also what pip does
if uri.startswith("git+") and "://" not in uri:
+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.1
requirementslib==1.0.2
attrs==18.1.0
distlib==0.2.7
packaging==17.1