Skip to content

Commit

Permalink
Merge pull request #11919 from sbidoul/deprecate-legacy-ignore-config…
Browse files Browse the repository at this point in the history
…-settings-sbi

Deprecate legacy projects ignoring config settings
  • Loading branch information
sbidoul authored Apr 15, 2023
2 parents dbf4e68 + 2ff2d0e commit 4f3a4f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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 @@ -486,6 +486,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

0 comments on commit 4f3a4f7

Please sign in to comment.