Skip to content

Deprecate legacy projects ignoring config settings #11919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions news/11915.removal.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/pip/_internal/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down