Skip to content

Commit 614e536

Browse files
authored
pip index versions: honor only-binary/no-binary options (#13683)
Currently, the `pip index versions` command does not honor the --only-binary and --no-binary switches, meaning that even with --only-binary we get all available versions including source distributions. Fix this by propagating format_control in SelectionPreferences. Signed-off-by: Julien Stephan <jstephan@baylibre.com>
1 parent db8121d commit 614e536

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

news/13682.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix "pip index versions" to honor only-binary/no-binary options

src/pip/_internal/commands/index.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def _build_package_finder(
9595
# Pass allow_yanked=False to ignore yanked versions.
9696
selection_prefs = SelectionPreferences(
9797
allow_yanked=False,
98+
format_control=options.format_control,
9899
allow_all_prereleases=options.pre,
99100
ignore_requires_python=ignore_requires_python,
100101
)

0 commit comments

Comments
 (0)