← Back
Editing: requirements.cpython-312.pyc
� &��j� � � � d dl mZ d dlmZ ddlmZ ddlmZ ddl m Z mZ ddlm Z mZ ddlmZ erd d lmZ d dgZdd�Z G d � d e� Z G d� d� Zy)� )�annotations)� TYPE_CHECKING� )�parse_requirement)�ParserSyntaxError)�Marker�_normalize_extra_values)�InvalidSpecifier�SpecifierSet��canonicalize_name)�Iterator�InvalidRequirement�Requirementc � � t S �N)�__all__� � �R/root/parts/certbot/install/lib/python3.12/site-packages/packaging/requirements.py�__dir__r s � ��Nr c � � e Zd ZdZy)r zf An invalid requirement was found, users should refer to PEP 508. .. versionadded:: 16.1 N)�__name__� __module__�__qualname__�__doc__r r r r r s � �r c �T � e Zd ZdZdZdd�Zd d�Zdd�Zdd�Zdd�Z dd�Z dd �Zdd �Zy)r a� 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. .. versionadded:: 16.1 .. versionchanged:: 22.0 Added equality (``__eq__``) and hashing (``__hash__``) so requirements can be compared and stored in sets / dicts. .. versionchanged:: 23.2 Equality and hashing began canonicalizing requirement names, so requirements whose names differ only by normalization (e.g. ``Requirement("Foo")`` vs ``Requirement("foo")``) now compare and hash equal. 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. .. versionchanged:: 26.3 The dedicated pickle support introduced in 26.2 did not preserve the specifier's explicit :attr:`~packaging.specifiers.SpecifierSet.prereleases` override; it is now included again. Equality and hashing normalize requirement names, extras, and equivalent specifiers. The string representation still preserves the parsed name and extras spelling. )�extras�marker�name� specifier�urlc � � t |� }|j | _ |j xs d | _ t |j � | _ t |j � | _ d | _ |j �Ct j t � | _ t |j � | j _ y y # t $ r}t t |� � |�d }~ww xY w# t $ r}t t |� � |�d }~ww xY wr )�_parse_requirementr r �strr r"