Separate functions for constructing setuptools args
To prepare for factoring these out into a separate module.
@@ -957,7 +957,7 @@ class WheelBuilder(object):
self._clean_one(req)
return None
- def _base_setup_args(self, req):
+ def _make_setuptools_bdist_wheel_args(self, req):
# NOTE: Eventually, we'd want to also -S to the flags here, when we're
# isolating. Currently, it breaks Python in virtualenvs, because it
# relies on site.py to find parts of the standard library outside the
@@ -968,6 +968,13 @@ class WheelBuilder(object):
unbuffered_output=True
)
+ def _make_setuptools_clean_args(self, req):
+ return make_setuptools_shim_args(
+ req.setup_py_path,
+ global_options=self.global_options,
+ unbuffered_output=True
+ )
+
def _build_one_pep517(self, req, tempd, python_tag=None):
"""Build one InstallRequirement using the PEP 517 build process.
@@ -1012,16 +1019,15 @@ class WheelBuilder(object):
Returns path to wheel if successfully built. Otherwise, returns None.
"""
- base_args = self._base_setup_args(req)
+ wheel_args = self._make_setuptools_bdist_wheel_args(req)
+ wheel_args += ['bdist_wheel', '-d', tempd]
+ wheel_args += self.build_options
+ if python_tag is not None:
+ wheel_args += ["--python-tag", python_tag]
spin_message = 'Building wheel for %s (setup.py)' % (req.name,)
with open_spinner(spin_message) as spinner:
logger.debug('Destination directory: %s', tempd)
- wheel_args = base_args + ['bdist_wheel', '-d', tempd] \
- + self.build_options
-
- if python_tag is not None:
- wheel_args += ["--python-tag", python_tag]
try:
output = call_subprocess(
@@ -1045,10 +1051,10 @@ class WheelBuilder(object):
return wheel_path
def _clean_one(self, req):
- base_args = self._base_setup_args(req)
+ clean_args = self._make_setuptools_clean_args(req)
+ clean_args += ['clean', '--all']
logger.info('Running setup.py clean for %s', req.name)
- clean_args = base_args + ['clean', '--all']
try:
call_subprocess(clean_args, cwd=req.source_dir)
return True
