mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Fix bug in lockfile generation
Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
+5
-4
@@ -785,10 +785,11 @@ class Project(object):
|
||||
|
||||
def get_lockfile_meta(self):
|
||||
from .vendor.plette.lockfiles import PIPFILE_SPEC_CURRENT
|
||||
sources = self.lockfile_content.get("_meta", {}).get("sources", [])
|
||||
if not sources:
|
||||
sources = self.pipfile_sources
|
||||
elif not isinstance(sources, list):
|
||||
if self.lockfile_exists:
|
||||
sources = self.lockfile_content.get("_meta", {}).get("sources", [])
|
||||
else:
|
||||
sources = [dict(source) for source in self.parsed_pipfile["source"]]
|
||||
if not isinstance(sources, list):
|
||||
sources = [sources,]
|
||||
return {
|
||||
"hash": {"sha256": self.calculate_pipfile_hash()},
|
||||
|
||||
+2
-2
@@ -320,7 +320,7 @@ class Resolver(object):
|
||||
if self.sources:
|
||||
requirementstxt_sources = " ".join(self.pip_args) if self.pip_args else ""
|
||||
requirementstxt_sources = requirementstxt_sources.replace(" --", "\n--")
|
||||
constraints_file.write(u"{0}\n".format(requirementstxt_sources))
|
||||
constraints_file.write(u"{0}\n".format(requirementstxt_sources))
|
||||
constraints = self.initial_constraints
|
||||
constraints_file.write(u"\n".join([c for c in constraints]))
|
||||
constraints_file.close()
|
||||
@@ -855,7 +855,7 @@ def mkdir_p(newdir):
|
||||
if exn.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
|
||||
|
||||
def is_required_version(version, specified_version):
|
||||
"""Check to see if there's a hard requirement for version
|
||||
number provided in the Pipfile.
|
||||
|
||||
Reference in New Issue
Block a user