Skip to content

Commit 4f3a4f7

Browse files
authored
Merge pull request #11919 from sbidoul/deprecate-legacy-ignore-config-settings-sbi
Deprecate legacy projects ignoring config settings
2 parents dbf4e68 + 2ff2d0e commit 4f3a4f7

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

news/11915.removal.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Using ``--config-settings`` with projects that don't have a ``pyproject.toml`` now print
2+
a deprecation warning. In the future the presence of config settings will automatically
3+
enable the default build backend for legacy projects and pass the setttings to it.

src/pip/_internal/pyproject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def load_pyproject_toml(
9191
# If we haven't worked out whether to use PEP 517 yet,
9292
# and the user hasn't explicitly stated a preference,
9393
# we do so if the project has a pyproject.toml file
94-
# or if we cannot import setuptools.
94+
# or if we cannot import setuptools or wheels.
9595

9696
# We fallback to PEP 517 when without setuptools or without the wheel package,
9797
# so setuptools can be installed as a default build backend.

src/pip/_internal/req/req_install.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,15 @@ def load_pyproject_toml(self) -> None:
486486
)
487487

488488
if pyproject_toml_data is None:
489+
if self.config_settings:
490+
deprecated(
491+
reason=f"Config settings are ignored for project {self}.",
492+
replacement=(
493+
"to use --use-pep517 or add a "
494+
"pyproject.toml file to the project"
495+
),
496+
gone_in="23.3",
497+
)
489498
self.use_pep517 = False
490499
return
491500

0 commit comments

Comments
 (0)