Skip to content

Commit d407d7e

Browse files
committed
Only pass --build-option to bdist_wheel in build_meta
In #2491 (comment) the discussion seems to lead to the idea that it is better for now to avoid passing any `--build-option` for commands that are not `bdist_wheel` in `setuptools.build_meta`.
1 parent 9ece3c9 commit d407d7e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

setuptools/build_meta.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ def _get_build_requires(self, config_settings, requirements):
318318
*sys.argv[:1],
319319
*self._global_args(config_settings),
320320
"egg_info",
321-
*self._arbitrary_args(config_settings),
322321
]
323322
try:
324323
with Distribution.patch():
@@ -406,14 +405,14 @@ def _build_with_temp_dir(
406405
# Build in a temporary directory, then copy to the target.
407406
os.makedirs(result_directory, exist_ok=True)
408407
temp_opts = {"prefix": ".tmp-", "dir": result_directory}
408+
409409
with tempfile.TemporaryDirectory(**temp_opts) as tmp_dist_dir:
410410
sys.argv = [
411411
*sys.argv[:1],
412412
*self._global_args(config_settings),
413413
*setup_command,
414414
"--dist-dir",
415415
tmp_dist_dir,
416-
*self._arbitrary_args(config_settings),
417416
]
418417
with no_install_setup_requires():
419418
self.run_setup()
@@ -432,7 +431,10 @@ def build_wheel(
432431
):
433432
with suppress_known_deprecation():
434433
return self._build_with_temp_dir(
435-
['bdist_wheel'], '.whl', wheel_directory, config_settings
434+
['bdist_wheel', *self._arbitrary_args(config_settings)],
435+
'.whl',
436+
wheel_directory,
437+
config_settings,
436438
)
437439

438440
def build_sdist(self, sdist_directory, config_settings=None):

0 commit comments

Comments
 (0)