pypa/pip · error · CommandError
--all-releases / --only-final option requires 1 argument.
Error message
--all-releases / --only-final option requires 1 argument.
What it means
Error "--all-releases / --only-final option requires 1 argument." thrown in pypa/pip.
Source
Thrown at src/pip/_internal/models/release_control.py:33
only_final: set[str] = field(default_factory=set)
_order: list[tuple[str, str]] = field(
init=False, default_factory=list, compare=False, repr=False
)
def handle_mutual_excludes(
self, value: str, target: set[str], other: set[str], attr_name: str
) -> None:
"""Parse and apply release control option value.
Processes comma-separated package names or special values `:all:` and `:none:`.
When adding packages to target, they're removed from other to maintain mutual
exclusivity between all_releases and only_final. All operations are tracked in
order so that the original command-line argument sequence can be reconstructed
when passing options to build subprocesses.
"""
if value.startswith("-"):
raise CommandError(
"--all-releases / --only-final option requires 1 argument."
)
new = value.split(",")
while ":all:" in new:
other.clear()
target.clear()
target.add(":all:")
# Track :all: in order
self._order.append((attr_name, ":all:"))
del new[: new.index(":all:") + 1]
# Without a none, we want to discard everything as :all: covers it
if ":none:" not in new:
return
for name in new:
if name == ":none:":
target.clear()
# Track :none: in order
self._order.append((attr_name, ":none:"))View on GitHub (pinned to d7d0d0a394)
When it happens
Trigger: Thrown at src/pip/_internal/models/release_control.py:33 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pypa/pip@d7d0d0a394 (2026-08-04).
Data as JSON: /data/errors/5e5be6b47d51e68b.json.
Report an issue: GitHub.