Skip to content

Commit

Permalink
Only pass --build-option to bdist_wheel in build_meta
Browse files Browse the repository at this point in the history
In pypa#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`.
  • Loading branch information
abravalheri committed Oct 13, 2023
1 parent 9ece3c9 commit d407d7e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setuptools/build_meta.py
Expand Up @@ -318,7 +318,6 @@ def _get_build_requires(self, config_settings, requirements):
*sys.argv[:1],
*self._global_args(config_settings),
"egg_info",
*self._arbitrary_args(config_settings),
]
try:
with Distribution.patch():
Expand Down Expand Up @@ -406,14 +405,14 @@ def _build_with_temp_dir(
# Build in a temporary directory, then copy to the target.
os.makedirs(result_directory, exist_ok=True)
temp_opts = {"prefix": ".tmp-", "dir": result_directory}

with tempfile.TemporaryDirectory(**temp_opts) as tmp_dist_dir:
sys.argv = [
*sys.argv[:1],
*self._global_args(config_settings),
*setup_command,
"--dist-dir",
tmp_dist_dir,
*self._arbitrary_args(config_settings),
]
with no_install_setup_requires():
self.run_setup()
Expand All @@ -432,7 +431,10 @@ def build_wheel(
):
with suppress_known_deprecation():
return self._build_with_temp_dir(
['bdist_wheel'], '.whl', wheel_directory, config_settings
['bdist_wheel', *self._arbitrary_args(config_settings)],
'.whl',
wheel_directory,
config_settings,
)

def build_sdist(self, sdist_directory, config_settings=None):
Expand Down

0 comments on commit d407d7e

Please sign in to comment.