diff --git a/news/11915.removal.rst b/news/11915.removal.rst new file mode 100644 index 00000000000..e54b5d574c0 --- /dev/null +++ b/news/11915.removal.rst @@ -0,0 +1,3 @@ +Using ``--config-settings`` with projects that don't have a ``pyproject.toml`` now print +a deprecation warning. In the future the presence of config settings will automatically +enable the default build backend for legacy projects and pass the setttings to it. diff --git a/src/pip/_internal/pyproject.py b/src/pip/_internal/pyproject.py index 57fef57077d..eb8e12b2dec 100644 --- a/src/pip/_internal/pyproject.py +++ b/src/pip/_internal/pyproject.py @@ -91,7 +91,7 @@ def load_pyproject_toml( # If we haven't worked out whether to use PEP 517 yet, # and the user hasn't explicitly stated a preference, # we do so if the project has a pyproject.toml file - # or if we cannot import setuptools. + # or if we cannot import setuptools or wheels. # We fallback to PEP 517 when without setuptools or without the wheel package, # so setuptools can be installed as a default build backend. diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index f0b7c5bcb14..2c628d36e93 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -477,6 +477,15 @@ def load_pyproject_toml(self) -> None: ) if pyproject_toml_data is None: + if self.config_settings: + deprecated( + reason=f"Config settings are ignored for project {self}.", + replacement=( + "to use --use-pep517 or add a " + "pyproject.toml file to the project" + ), + gone_in="23.3", + ) self.use_pep517 = False return