REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 3.32 KB
Close
//opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/models/release_control.py
Text
Base64
from __future__ import annotations from dataclasses import dataclass, field from pip._vendor.packaging.utils import NormalizedName, canonicalize_name from pip._internal.exceptions import CommandError # TODO: add slots=True when Python 3.9 is dropped @dataclass class ReleaseControl: """Helper for managing which release types can be installed.""" all_releases: set[str] = field(default_factory=set) 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:")) continue name = canonicalize_name(name) other.discard(name) target.add(name) # Track package-specific setting in order self._order.append((attr_name, name)) def get_ordered_args(self) -> list[tuple[str, str]]: """ Get ordered list of (flag_name, value) tuples for reconstructing CLI args. Returns: List of tuples where each tuple is (attribute_name, value). The attribute_name is either 'all_releases' or 'only_final'. Example: [("all_releases", ":all:"), ("only_final", "simple")] would be reconstructed as: ["--all-releases", ":all:", "--only-final", "simple"] """ return self._order[:] def allows_prereleases(self, canonical_name: NormalizedName) -> bool | None: """ Determine if pre-releases are allowed for a package. Returns: True: Pre-releases are allowed (package in all_releases) False: Only final releases allowed (package in only_final) None: No specific setting, use default behavior """ if canonical_name in self.all_releases: return True elif canonical_name in self.only_final: return False elif ":all:" in self.all_releases: return True elif ":all:" in self.only_final: return False return None
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-06-08 20:23:13
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
candidate.py
753 B
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
direct_url.py
6.40 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
format_control.py
2.41 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.py
1.01 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
installation_report.py
2.77 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
link.py
21.48 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
release_control.py
3.32 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
scheme.py
575 B
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
search_scope.py
4.40 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
selection_prefs.py
2.17 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
target_python.py
4.14 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
wheel.py
2.85 KB
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
62 B
lrw-r--r--
2026-04-14 09:45:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).