mirror of https://github.com/pypa/pip
Address review comments
This commit is contained in:
parent
27cb7f36cc
commit
8dad780026
|
@ -67,7 +67,7 @@ class BuildEnvironment(object):
|
|||
self._temp_dir.cleanup()
|
||||
|
||||
|
||||
class FakeBuildEnvironment(BuildEnvironment):
|
||||
class NoOpBuildEnvironment(BuildEnvironment):
|
||||
def __enter__(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ from pip._internal.utils.ui import open_spinner
|
|||
from pip._internal.vcs import vcs
|
||||
from pip._internal.req.req_install import InstallRequirement
|
||||
from pip._internal.index import FormatControl
|
||||
from pip._internal.build_env import FakeBuildEnvironment
|
||||
from pip._internal.build_env import NoOpBuildEnvironment
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -113,6 +113,9 @@ class IsSDist(DistAbstraction):
|
|||
return dist
|
||||
|
||||
def prep_for_dist(self, finder):
|
||||
# Before calling "setup.py egg_info", we need to set-up the build
|
||||
# environment.
|
||||
|
||||
build_requirements, isolate = self.req.get_pep_518_info()
|
||||
|
||||
if 'setuptools' not in build_requirements:
|
||||
|
@ -122,11 +125,9 @@ class IsSDist(DistAbstraction):
|
|||
"upgrade to a newer version of pip.")
|
||||
|
||||
if not isolate:
|
||||
self.req.build_environment = FakeBuildEnvironment(no_clean=False)
|
||||
self.req.build_env = NoOpBuildEnvironment(no_clean=False)
|
||||
|
||||
with self.req.build_environment as prefix:
|
||||
# Ignore the --no-binary option when installing the build system, so
|
||||
# we don't recurse trying to build a self-hosting build system.
|
||||
with self.req.build_env as prefix:
|
||||
if isolate:
|
||||
_install_build_reqs(finder, prefix, build_requirements)
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ class InstallRequirement(object):
|
|||
self.prepared = False
|
||||
|
||||
self.isolated = isolated
|
||||
self.build_environment = BuildEnvironment(no_clean=True)
|
||||
self.build_env = BuildEnvironment(no_clean=True)
|
||||
|
||||
@classmethod
|
||||
def from_editable(cls, editable_req, comes_from=None, isolated=False,
|
||||
|
@ -882,7 +882,7 @@ class InstallRequirement(object):
|
|||
rmtree(self.source_dir)
|
||||
self.source_dir = None
|
||||
self._temp_build_dir.cleanup()
|
||||
self.build_environment.cleanup()
|
||||
self.build_env.cleanup()
|
||||
|
||||
def install_editable(self, install_options,
|
||||
global_options=(), prefix=None):
|
||||
|
|
|
@ -187,7 +187,7 @@ class Resolver(object):
|
|||
|
||||
if req.editable:
|
||||
return self.preparer.prepare_editable_requirement(
|
||||
req, self.require_hashes, self.finder
|
||||
req, self.require_hashes, self.finder,
|
||||
)
|
||||
|
||||
# satisfied_by is only evaluated by calling _check_skip_installed,
|
||||
|
|
Loading…
Reference in New Issue