Skip to content

Commit

Permalink
Fix for source directory reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed May 21, 2020
1 parent a7b6430 commit 9024011
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import shutil
import sys
import uuid
import zipfile

from pip._vendor import pkg_resources, six
Expand Down Expand Up @@ -354,16 +355,16 @@ def ensure_build_location(self, build_dir, autodelete):
)

return self._temp_build_dir.path
if self.editable:
name = self.name.lower()
else:
name = self.name
dir_name = "{}_{}".format(
canonicalize_name(self.name),
uuid.uuid4().hex,
)
# FIXME: Is there a better place to create the build_dir? (hg and bzr
# need this)
if not os.path.exists(build_dir):
logger.debug('Creating directory %s', build_dir)
os.makedirs(build_dir)
actual_build_dir = os.path.join(build_dir, name)
actual_build_dir = os.path.join(build_dir, dir_name)
# `None` indicates that we respect the globally-configured deletion
# settings, which is what we actually want when auto-deleting.
delete_arg = None if autodelete else False
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_new_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,6 @@ def test_new_resolver_extra_merge_in_package(
assert_installed(script, pkg="1.0.0", dep="1.0.0", depdev="1.0.0")


@pytest.mark.xfail(reason="pre-existing build directory")
def test_new_resolver_build_directory_error_zazo_19(script):
"""https://github.com/pradyunsg/zazo/issues/19#issuecomment-631615674
Expand Down

0 comments on commit 9024011

Please sign in to comment.