{"id":"5e5be6b47d51e68b","repo":"pypa/pip","slug":"all-releases-only-final-option-requires-1-ar","errorCode":null,"errorMessage":"--all-releases / --only-final option requires 1 argument.","messagePattern":"--all-releases / --only-final option requires 1 argument\\.","errorType":"validation","errorClass":"CommandError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/models/release_control.py","lineNumber":33,"sourceCode":"    only_final: set[str] = field(default_factory=set)\n    _order: list[tuple[str, str]] = field(\n        init=False, default_factory=list, compare=False, repr=False\n    )\n\n    def handle_mutual_excludes(\n        self, value: str, target: set[str], other: set[str], attr_name: str\n    ) -> None:\n        \"\"\"Parse and apply release control option value.\n\n        Processes comma-separated package names or special values `:all:` and `:none:`.\n\n        When adding packages to target, they're removed from other to maintain mutual\n        exclusivity between all_releases and only_final. All operations are tracked in\n        order so that the original command-line argument sequence can be reconstructed\n        when passing options to build subprocesses.\n        \"\"\"\n        if value.startswith(\"-\"):\n            raise CommandError(\n                \"--all-releases / --only-final option requires 1 argument.\"\n            )\n        new = value.split(\",\")\n        while \":all:\" in new:\n            other.clear()\n            target.clear()\n            target.add(\":all:\")\n            # Track :all: in order\n            self._order.append((attr_name, \":all:\"))\n            del new[: new.index(\":all:\") + 1]\n            # Without a none, we want to discard everything as :all: covers it\n            if \":none:\" not in new:\n                return\n        for name in new:\n            if name == \":none:\":\n                target.clear()\n                # Track :none: in order\n                self._order.append((attr_name, \":none:\"))","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/pypa/pip/blob/d7d0d0a39494e28ec1c407bd0680e4a4d1067791/src/pip/_internal/models/release_control.py#L15-L51","documentation":"Error \"--all-releases / --only-final option requires 1 argument.\" thrown in pypa/pip.","triggerScenarios":"Thrown at src/pip/_internal/models/release_control.py:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"d7d0d0a39494e28ec1c407bd0680e4a4d1067791","analyzedAt":"2026-08-04T20:55:04.259Z","schemaVersion":2}