Don't write editable requirements to a temporary file

We never need to read from the file, so it's unnecessary.
This commit is contained in:
Daniel Watkins
2017-12-21 15:48:22 -05:00
parent 416eb667fd
commit 7025b682ab
2 changed files with 4 additions and 4 deletions
+3 -4
View File
@@ -462,13 +462,12 @@ def actually_resolve_reps(deps, index_lookup, markers_lookup, project, sources,
constraints = []
for dep in deps:
t = tempfile.mkstemp(prefix='pipenv-', suffix='-requirement.txt')[1]
with open(t, 'w') as f:
f.write(dep)
if dep.startswith('-e '):
constraint = pip.req.InstallRequirement.from_editable(dep[len('-e '):])
else:
t = tempfile.mkstemp(prefix='pipenv-', suffix='-requirement.txt')[1]
with open(t, 'w') as f:
f.write(dep)
constraint = [c for c in pip.req.parse_requirements(t, session=pip._vendor.requests)][0]
if ' -i ' in dep:
+1
View File
@@ -435,6 +435,7 @@ setup(
assert 'idna' in p.lockfile['default']
assert 'urllib3' in p.lockfile['default']
assert 'certifi' in p.lockfile['default']
assert os.listdir(p.tmpdir) == []
@pytest.mark.install
@pytest.mark.pin