Skip to content

Commit 2cf9db2

Browse files
authored
Merge pull request #11861 from sbidoul/deprecate-build-global-option-sbi
Deprecate --build-option and --global-option
2 parents 0187bf6 + 6adb7af commit 2cf9db2

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

news/11859.removal.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Deprecate ``--build-option`` and ``--global-option``. Users are invited to switch to
2+
``--config-settings``.

src/pip/_internal/req/req_install.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,9 +894,14 @@ def check_legacy_setup_py_options(
894894
has_build_options = _has_option(options, reqs, "build_options")
895895
has_global_options = _has_option(options, reqs, "global_options")
896896
if has_build_options or has_global_options:
897+
deprecated(
898+
reason="--build-option and --global-option are deprecated.",
899+
issue=11859,
900+
replacement="to use --config-settings",
901+
gone_in="23.3",
902+
)
897903
logger.warning(
898904
"Implying --no-binary=:all: due to the presence of "
899905
"--build-option / --global-option. "
900-
"Consider using --config-settings for more flexibility.",
901906
)
902907
options.format_control.disallow_binaries()

tests/functional/test_install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ def test_install_global_option(script: PipTestEnvironment) -> None:
834834
assert "INITools==0.1\n" in result.stdout
835835
assert not result.files_created
836836
assert "Implying --no-binary=:all:" in result.stderr
837-
assert "Consider using --config-settings" in result.stderr
837+
assert "A possible replacement is to use --config-settings" in result.stderr
838838

839839

840840
def test_install_with_hacked_egg_info(

0 commit comments

Comments
 (0)