diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py index 9267cf312f6..ba45cb579ae 100644 --- a/setuptools/build_meta.py +++ b/setuptools/build_meta.py @@ -284,10 +284,9 @@ def _arbitrary_args(self, config_settings: _ConfigSettings) -> Iterator[str]: ['foo'] >>> list(fn({'--build-option': 'foo bar'})) ['foo', 'bar'] - >>> warnings.simplefilter('error', SetuptoolsDeprecationWarning) >>> list(fn({'--global-option': 'foo'})) # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): - SetuptoolsDeprecationWarning: ...arguments given via `--global-option`... + ValueError: Incompatible ...`foo`... """ args = self._get_config("--global-option", config_settings) global_opts = self._valid_global_options() @@ -301,15 +300,8 @@ def _arbitrary_args(self, config_settings: _ConfigSettings) -> Iterator[str]: yield from self._get_config("--build-option", config_settings) if bad_args: - SetuptoolsDeprecationWarning.emit( - "Incompatible `config_settings` passed to build backend.", - f""" - The arguments {bad_args!r} were given via `--global-option`. - Please use `--build-option` instead, - `--global-option` is reserved for flags like `--verbose` or `--quiet`. - """, - due_date=(2023, 9, 26), # Warning introduced in v64.0.1, 11/Aug/2022. - ) + msg = f"Incompatible `config_settings`: {bad_args!r} ({config_settings!r})" + raise ValueError(msg) class _BuildMetaBackend(_ConfigSettingsTranslator): diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index fd7cf168cef..244b76d0828 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -700,25 +700,6 @@ def _assert_link_tree(self, parent_dir): for file in files: assert file.is_symlink() or os.stat(file).st_nlink > 0 - @pytest.mark.filterwarnings("ignore::setuptools.SetuptoolsDeprecationWarning") - # Since the backend is running via a process pool, in some operating systems - # we may have problems to make assertions based on warnings/stdout/stderr... - # So the best is to ignore them for the time being. - def test_editable_with_global_option_still_works(self, tmpdir_cwd): - """The usage of --global-option is now discouraged in favour of --build-option. - This is required to make more sense of the provided scape hatch and align with - previous pip behaviour. See pypa/setuptools#1928. - """ - path.build({**self._simple_pyproject_example, '_meta': {}}) - build_backend = self.get_build_backend() - assert not Path("build").exists() - - cfg = {"--global-option": ["--mode", "strict"]} - build_backend.prepare_metadata_for_build_editable("_meta", cfg) - build_backend.build_editable("temp", cfg, "_meta") - - self._assert_link_tree(next(Path("build").glob("__editable__.*"))) - def test_editable_without_config_settings(self, tmpdir_cwd): """ Sanity check to ensure tests with --mode=strict are different from the ones