Skip to content

Commit

Permalink
Remove deprecated handling of build-option passed as global-option
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Nov 20, 2023
1 parent 7c111b8 commit f431962
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions setuptools/build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,25 +284,11 @@ def _arbitrary_args(self, config_settings: _ConfigSettings) -> Iterator[str]:
['foo']
>>> list(fn({'--build-option': 'foo bar'}))
['foo', 'bar']
>>> list(fn({'--global-option': 'foo'})) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
ValueError: Incompatible .config_settings. ...'foo'...
>>> list(fn({'--global-option': 'foo'}))
[]
"""
args = self._get_config("--global-option", config_settings)
global_opts = self._valid_global_options()
bad_args = []

for arg in args:
if arg.strip("-") not in global_opts:
bad_args.append(arg)
yield arg

yield from self._get_config("--build-option", config_settings)

if bad_args:
msg = f"Incompatible `config_settings`: {bad_args!r} ({config_settings!r})"
raise errors.InvalidConfigError(msg)


class _BuildMetaBackend(_ConfigSettingsTranslator):
def _get_build_requires(self, config_settings, requirements):
Expand Down

0 comments on commit f431962

Please sign in to comment.