mirror of https://github.com/pypa/pip
Merge pull request #7575 from chrahunt/refactor/clean-up-source-dir-handling-1
Minor cleanups in source dir handling
This commit is contained in:
commit
e06a12ef1d
|
@ -420,6 +420,8 @@ class RequirementPreparer(object):
|
|||
# editable in a req, a non deterministic error
|
||||
# occurs when the script attempts to unpack the
|
||||
# build directory
|
||||
# Since source_dir is only set for editable requirements.
|
||||
assert req.source_dir is None
|
||||
req.ensure_has_source_dir(self.build_dir)
|
||||
# If a checkout exists, it's unwise to keep going. version
|
||||
# inconsistencies are logged later, but do not fail the
|
||||
|
|
|
@ -36,9 +36,9 @@ from pip._internal.utils.logging import indent_log
|
|||
from pip._internal.utils.marker_files import (
|
||||
PIP_DELETE_MARKER_FILENAME,
|
||||
has_delete_marker_file,
|
||||
write_delete_marker_file,
|
||||
)
|
||||
from pip._internal.utils.misc import (
|
||||
_make_build_dir,
|
||||
ask_path_exists,
|
||||
backup_dir,
|
||||
display_path,
|
||||
|
@ -370,7 +370,8 @@ class InstallRequirement(object):
|
|||
# need this)
|
||||
if not os.path.exists(build_dir):
|
||||
logger.debug('Creating directory %s', build_dir)
|
||||
_make_build_dir(build_dir)
|
||||
os.makedirs(build_dir)
|
||||
write_delete_marker_file(build_dir)
|
||||
return os.path.join(build_dir, name)
|
||||
|
||||
def _set_requirement(self):
|
||||
|
|
|
@ -39,7 +39,6 @@ from pip._internal.utils.compat import (
|
|||
stdlib_pkgs,
|
||||
str_to_display,
|
||||
)
|
||||
from pip._internal.utils.marker_files import write_delete_marker_file
|
||||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING, cast
|
||||
from pip._internal.utils.virtualenv import (
|
||||
running_under_virtualenv,
|
||||
|
@ -523,11 +522,6 @@ def write_output(msg, *args):
|
|||
logger.info(msg, *args)
|
||||
|
||||
|
||||
def _make_build_dir(build_dir):
|
||||
os.makedirs(build_dir)
|
||||
write_delete_marker_file(build_dir)
|
||||
|
||||
|
||||
class FakeFile(object):
|
||||
"""Wrap a list of lines in an object with readline() to make
|
||||
ConfigParser happy."""
|
||||
|
|
Loading…
Reference in New Issue