Merge pull request #3431 from pypa/bugfix/3427

Populate source when getting lockfile
This commit is contained in:
Frost Ming
2019-01-11 08:52:00 +08:00
committed by GitHub
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
Fix a bug that ``ValidationError`` is thrown when some fields are missing in source section.
+1 -1
View File
@@ -780,7 +780,7 @@ class Project(object):
return {
"hash": {"sha256": self.calculate_pipfile_hash()},
"pipfile-spec": PIPFILE_SPEC_CURRENT,
"sources": sources,
"sources": [self.populate_source(s) for s in sources],
"requires": self.parsed_pipfile.get("requires", {})
}
+3
View File
@@ -491,6 +491,7 @@ def test_lockfile_with_empty_dict(PipenvInstance):
@pytest.mark.lock
@pytest.mark.skip_lock
@pytest.mark.install
def test_lock_with_incomplete_source(PipenvInstance, pypi):
with PipenvInstance(pypi=pypi, chdir=True) as p:
@@ -502,6 +503,8 @@ url = "https://test.pypi.org/simple"
[packages]
requests = "*"
""")
c = p.pipenv('install --skip-lock')
assert c.return_code == 0
c = p.pipenv('install')
assert c.return_code == 0
assert p.lockfile['_meta']['sources']