mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 14:50:16 +00:00
Use constraint lines to update requirements
Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
+2
-2
@@ -251,7 +251,7 @@ def actually_resolve_deps(
|
||||
# req.as_line() is theoratically the same as dep, but is guaranteed to
|
||||
# be normalized. This is safer than passing in dep.
|
||||
# TODO: Stop passing dep lines around; just use requirement objects.
|
||||
constraints.append(req.requirement.line)
|
||||
constraints.append(req.constraint_line)
|
||||
# extra_constraints = []
|
||||
|
||||
if url:
|
||||
@@ -1220,7 +1220,7 @@ def clean_resolved_dep(dep, is_top_level=False, pipfile_entry=None):
|
||||
lockfile = {
|
||||
'version': '=={0}'.format(dep['version']),
|
||||
}
|
||||
for key in ['hashes', 'index']:
|
||||
for key in ['hashes', 'index', 'extras']:
|
||||
if key in dep:
|
||||
lockfile[key] = dep[key]
|
||||
# In case we lock a uri or a file when the user supplied a path
|
||||
|
||||
+7
-1
@@ -566,7 +566,7 @@ class Requirement(object):
|
||||
name, extras = _strip_extras(name)
|
||||
if version:
|
||||
name = '{0}{1}'.format(name, version)
|
||||
r = NamedRequirement.from_line(name)
|
||||
r = NamedRequirement.from_line(line)
|
||||
if extras:
|
||||
extras = first(
|
||||
requirements.parse("fakepkg{0}".format(extras_to_string(extras)))
|
||||
@@ -639,6 +639,12 @@ class Requirement(object):
|
||||
line = "{0} {1}".format(line, index_string)
|
||||
return line
|
||||
|
||||
@property
|
||||
def constraint_line(self):
|
||||
if self.is_named or self.is_vcs:
|
||||
return self.as_line()
|
||||
return self.req.req.line
|
||||
|
||||
def as_pipfile(self):
|
||||
good_keys = (
|
||||
"hashes",
|
||||
|
||||
Reference in New Issue
Block a user