Skip to content

Commit 6adb7af

Browse files
sbidoulpradyunsg
authored andcommitted
Deprecate --build-option and --global-option
1 parent ade3826 commit 6adb7af

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
@@ -843,7 +843,7 @@ def test_install_global_option(script: PipTestEnvironment) -> None:
843843
assert "INITools==0.1\n" in result.stdout
844844
assert not result.files_created
845845
assert "Implying --no-binary=:all:" in result.stderr
846-
assert "Consider using --config-settings" in result.stderr
846+
assert "A possible replacement is to use --config-settings" in result.stderr
847847

848848

849849
def test_install_with_hacked_egg_info(

0 commit comments

Comments
 (0)