✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.62
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/hc_python/lib/python3.12/site-packages/packaging//requirements.py
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import annotations

from typing import Iterator

from ._parser import parse_requirement as _parse_requirement
from ._tokenizer import ParserSyntaxError
from .markers import Marker, _normalize_extra_values
from .specifiers import SpecifierSet
from .utils import canonicalize_name

__all__ = [
    "InvalidRequirement",
    "Requirement",
]


def __dir__() -> list[str]:
    return __all__


class InvalidRequirement(ValueError):
    """
    An invalid requirement was found, users should refer to PEP 508.
    """


class Requirement:
    """Parse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.

    Instances are safe to serialize with :mod:`pickle`. They use a stable
    format so the same pickle can be loaded in future packaging releases.

    .. versionchanged:: 26.2

        Added a stable pickle format. Pickles created with packaging 26.2+ can
        be unpickled with future releases.  Backward compatibility with pickles
        from packaging < 26.2 is supported but may be removed in a future
        release.
    """

    # TODO: Can we test whether something is contained within a requirement?
    #       If so how do we do that? Do we need to test against the _name_ of
    #       the thing as well as the version? What about the markers?
    # TODO: Can we normalize the name and extra name?

    def __init__(self, requirement_string: str) -> None:
        try:
            parsed = _parse_requirement(requirement_string)
        except ParserSyntaxError as e:
            raise InvalidRequirement(str(e)) from e

        self.name: str = parsed.name
        self.url: str | None = parsed.url or None
        self.extras: set[str] = set(parsed.extras or [])
        self.specifier: SpecifierSet = SpecifierSet(parsed.specifier)
        self.marker: Marker | None = None
        if parsed.marker is not None:
            self.marker = Marker.__new__(Marker)
            self.marker._markers = _normalize_extra_values(parsed.marker)

    def _iter_parts(self, name: str) -> Iterator[str]:
        yield name

        if self.extras:
            formatted_extras = ",".join(sorted(self.extras))
            yield f"[{formatted_extras}]"

        if self.specifier:
            yield str(self.specifier)

        if self.url:
            yield f" @ {self.url}"
            if self.marker:
                yield " "

        if self.marker:
            yield f"; {self.marker}"

    def __getstate__(self) -> str:
        # Return the requirement string for compactness and stability.
        # Re-parsed on load to reconstruct all fields.
        return str(self)

    def __setstate__(self, state: object) -> None:
        if isinstance(state, str):
            # New format (26.2+): just the requirement string.
            try:
                tmp = Requirement(state)
            except InvalidRequirement as exc:
                raise TypeError(f"Cannot restore Requirement from {state!r}") from exc
            self.name = tmp.name
            self.url = tmp.url
            self.extras = tmp.extras
            self.specifier = tmp.specifier
            self.marker = tmp.marker
            return
        if isinstance(state, dict):
            # Old format (packaging <= 26.1, no __slots__): plain __dict__.
            self.__dict__.update(state)
            return
        raise TypeError(f"Cannot restore Requirement from {state!r}")

    def __str__(self) -> str:
        return "".join(self._iter_parts(self.name))

    def __repr__(self) -> str:
        return f"<{self.__class__.__name__}({str(self)!r})>"

    def __hash__(self) -> int:
        return hash(tuple(self._iter_parts(canonicalize_name(self.name))))

    def __eq__(self, other: object) -> bool:
        if not isinstance(other, Requirement):
            return NotImplemented

        return (
            canonicalize_name(self.name) == canonicalize_name(other.name)
            and self.extras == other.extras
            and self.specifier == other.specifier
            and self.url == other.url
            and self.marker == other.marker
        )


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Jun 2026 5.00 AM
root / root
0755
__pycache__
--
11 Jun 2026 5.00 AM
root / root
0755
licenses
--
11 Jun 2026 5.00 AM
root / root
0755
__init__.py
0.482 KB
11 Jun 2026 5.00 AM
root / root
0644
_elffile.py
3.136 KB
11 Jun 2026 5.00 AM
root / root
0644
_manylinux.py
9.335 KB
11 Jun 2026 5.00 AM
root / root
0644
_musllinux.py
2.644 KB
11 Jun 2026 5.00 AM
root / root
0644
_parser.py
11.424 KB
11 Jun 2026 5.00 AM
root / root
0644
_structures.py
1.083 KB
11 Jun 2026 5.00 AM
root / root
0644
_tokenizer.py
5.265 KB
11 Jun 2026 5.00 AM
root / root
0644
dependency_groups.py
9.979 KB
11 Jun 2026 5.00 AM
root / root
0644
direct_url.py
10.661 KB
11 Jun 2026 5.00 AM
root / root
0644
errors.py
2.617 KB
11 Jun 2026 5.00 AM
root / root
0644
markers.py
16.655 KB
11 Jun 2026 5.00 AM
root / root
0644
metadata.py
37.861 KB
11 Jun 2026 5.00 AM
root / root
0644
py.typed
0 KB
11 Jun 2026 5.00 AM
root / root
0644
pylock.py
33.096 KB
11 Jun 2026 5.00 AM
root / root
0644
requirements.py
4.28 KB
11 Jun 2026 5.00 AM
root / root
0644
specifiers.py
69.838 KB
11 Jun 2026 5.00 AM
root / root
0644
tags.py
33.422 KB
11 Jun 2026 5.00 AM
root / root
0644
utils.py
9.617 KB
11 Jun 2026 5.00 AM
root / root
0644
version.py
37.47 KB
11 Jun 2026 5.00 AM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF