Invoke method only when build isolation is needed
@@ -29,12 +29,13 @@ class SourceDistribution(AbstractDistribution):
self.req.load_pyproject_toml()
should_isolate = self.req.use_pep517 and build_isolation
- self._setup_isolation(should_isolate, finder)
+ if should_isolate:
+ self._setup_isolation(finder)
self.req.prepare_metadata()
self.req.assert_source_matches_version()
- def _setup_isolation(self, should_isolate, finder):
+ def _setup_isolation(self, finder):
def _raise_conflicts(conflicting_with, conflicting_reqs):
raise InstallationError(
"Some build dependencies for %s conflict with %s: %s." % (
@@ -42,7 +43,6 @@ class SourceDistribution(AbstractDistribution):
'%s is incompatible with %s' % (installed, wanted)
for installed, wanted in sorted(conflicting))))
- if should_isolate:
# Isolate in a BuildEnvironment and install the build-time
# requirements.
self.req.build_env = BuildEnvironment()
