Skip to content

Commit 8585c5e

Browse files
committed
Append arbitrary args instead of prepending.
1 parent e4cca0e commit 8585c5e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

newsfragments/4217.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix argument order of ``--config-settings["--build-option"]`` arguments.
2+
This was broken by <https://github.com/pypa/setuptools/pull/4079>`.

setuptools/build_meta.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def prepare_metadata_for_build_wheel(
369369
return self._bubble_up_info_directory(metadata_directory, ".dist-info")
370370

371371
def _build_with_temp_dir(
372-
self, setup_command, result_extension, result_directory, config_settings
372+
self, setup_command, result_extension, result_directory, config_settings, arbitrary_args=False
373373
):
374374
result_directory = os.path.abspath(result_directory)
375375

@@ -385,6 +385,8 @@ def _build_with_temp_dir(
385385
"--dist-dir",
386386
tmp_dist_dir,
387387
]
388+
if arbitrary_args:
389+
sys.argv += self._arbitrary_args(config_settings)
388390
with no_install_setup_requires():
389391
self.run_setup()
390392

@@ -402,10 +404,11 @@ def build_wheel(
402404
):
403405
with suppress_known_deprecation():
404406
return self._build_with_temp_dir(
405-
['bdist_wheel', *self._arbitrary_args(config_settings)],
407+
['bdist_wheel'],
406408
'.whl',
407409
wheel_directory,
408410
config_settings,
411+
True,
409412
)
410413

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

0 commit comments

Comments
 (0)