관리-도구
편집 파일: base.cpython-39.opt-1.pyc
a ����[��f_+����������������������@���sR��d�dl�Zd�dlZd�dlZd�dlZd�dlZd�dlmZmZm Z m Z mZmZm Z mZmZ�d�dlmZ�d�dlmZmZ�d�dlmZ�d�dlmZmZ�d�dlmZmZmZ�d�dlmZ�d�d l m!Z!�d�d l"m#Z#�er�d�dlm$Z$�ne%Z$eeef�Z&e�'e(�Z)G�dd ��d e$�Z*G�dd��de$�Z+G�dd��d�Z,G�dd��de$�Z-G�dd��de-�Z.G�dd��de-�Z/dS�)�����N) �IO� TYPE_CHECKING� Collection� Container�Iterable�Iterator�List�Optional�Union)�Requirement)�InvalidSpecifier�SpecifierSet)�NormalizedName)� LegacyVersion�Version)�DIRECT_URL_METADATA_NAME� DirectUrl�DirectUrlValidationError)�stdlib_pkgs)�egg_link_path_from_sys_path)�url_to_path)�Protocolc�������������������@���sB���e�Zd�Zeed�dd��Zeed�dd��Zeed�dd��ZdS�) �BaseEntryPoint��returnc�����������������C���s ���t����d�S��N��NotImplementedError��self��r ����?/usr/lib/python3.9/site-packages/pip/_internal/metadata/base.py�name+���s����zBaseEntryPoint.namec�����������������C���s ���t����d�S�r���r���r���r ���r ���r!����value/���s����zBaseEntryPoint.valuec�����������������C���s ���t����d�S�r���r���r���r ���r ���r!����group3���s����zBaseEntryPoint.groupN)�__name__� __module__�__qualname__�property�strr"���r#���r$���r ���r ���r ���r!���r���*���s���r���c�������������������@���s���e�Zd�Zed�dd�Zed�dd�Zeee�d�dd��Zeee�d�dd ��Z eee�d�d d��Z eed�dd ��Zee d�dd��Zeee�d�dd��Zeed�dd��Zeed�dd��Zeed�dd��Zeed�dd��Zeed�dd��Zeed�dd�Zee�d�dd �Zeejjd�d!d"��Zeee�d�d#d$��Zeed�d%d&��Z ee!d�d'd(��Z"d0e#e�ee$�d*�d+d,�Z%ee�d�d-d.�Z&d/S�)1�BaseDistributionr���c�����������������C���s���|�j���d|�j��d|�j��d�S�)N� z (�))�raw_name�version�locationr���r ���r ���r!����__repr__9���s����zBaseDistribution.__repr__c�����������������C���s���|�j���d|�j���S�)Nr+���)r-���r.���r���r ���r ���r!����__str__<���s����zBaseDistribution.__str__c�����������������C���s ���t����dS�)a���Where the distribution is loaded from. A string value is not necessarily a filesystem path, since distributions can be loaded from other sources, e.g. arbitrary zip archives. ``None`` means the distribution is created in-memory. Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If this is a symbolic link, we want to preserve the relative path between it and files in the distribution. Nr���r���r ���r ���r!���r/���?���s����zBaseDistribution.locationc�����������������C���s6���|�j�}|r|���r2t|j�S�nt|�j�}|r2|�jS�dS�)z�The project location for editable distributions. This is the directory where pyproject.toml or setup.py is located. None if the distribution is not installed in editable mode. N)� direct_urlZis_local_editabler����urlr���r-���r/���)r���r2���Z egg_link_pathr ���r ���r!����editable_project_locationM���s���� z*BaseDistribution.editable_project_locationc�����������������C���s ���t����dS�)a'��Location of the .[egg|dist]-info directory. Similarly to ``location``, a string value is not necessarily a filesystem path. ``None`` means the distribution is created in-memory. For a modern .dist-info installation on disk, this should be something like ``{location}/{raw_name}-{version}.dist-info``. Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If this is a symbolic link, we want to preserve the relative path between it and other files in the distribution. Nr���r���r ���r ���r!����info_directoryc���s����zBaseDistribution.info_directoryc�����������������C���s ���t����d�S�r���r���r���r ���r ���r!����canonical_names���s����zBaseDistribution.canonical_namec�����������������C���s ���t����d�S�r���r���r���r ���r ���r!���r.���w���s����zBaseDistribution.versionc�������������� ���C���sv���z|���t�}W�n�ty"���Y�dS�0�zt�|�W�S��ttjtfyp�}�z t � dt|�j|��W�Y�d}~dS�d}~0�0�dS�)z�Obtain a DirectUrl from this distribution. Returns None if the distribution has no `direct_url.json` metadata, or if `direct_url.json` is invalid. NzError parsing %s for %s: %s)� read_textr����FileNotFoundErrorr���Z from_json�UnicodeDecodeError�jsonZJSONDecodeErrorr����logger�warningr6���)r���Zcontent�er ���r ���r!���r2���{���s$������zBaseDistribution.direct_urlc�����������������C���s ���t����d�S�r���r���r���r ���r ���r!���� installer����s����zBaseDistribution.installerc�����������������C���s ���t�|�j�S�r���)�boolr4���r���r ���r ���r!����editable����s����zBaseDistribution.editablec�����������������C���s ���t����d�S�r���r���r���r ���r ���r!����local����s����zBaseDistribution.localc�����������������C���s ���t����d�S�r���r���r���r ���r ���r!����in_usersite����s����zBaseDistribution.in_usersitec�����������������C���s ���t����d�S�r���r���r���r ���r ���r!����in_site_packages����s����z!BaseDistribution.in_site_packages�r"���r���c�����������������C���s ���t����dS�)z�Read a file in the .dist-info (or .egg-info) directory. Should raise ``FileNotFoundError`` if ``name`` does not exist in the metadata directory. Nr����r���r"���r ���r ���r!���r7�������s����zBaseDistribution.read_textc�����������������C���s ���t����d�S�r���r���r���r ���r ���r!����iter_entry_points����s����z"BaseDistribution.iter_entry_pointsc�����������������C���s ���t����dS�)z?Metadata of distribution parsed from e.g. METADATA or PKG-INFO.Nr���r���r ���r ���r!����metadata����s����zBaseDistribution.metadatac�����������������C���s���|�j��d�S�)zDValue of "Metadata-Version:" in distribution metadata, if available.zMetadata-Version)rG����getr���r ���r ���r!����metadata_version����s����z!BaseDistribution.metadata_versionc�����������������C���s���|�j��d|�j�S�)z*Value of "Name:" in distribution metadata.�Name)rG���rH���r6���r���r ���r ���r!���r-�������s����zBaseDistribution.raw_namec�������������� ���C���sn���|�j��d�}|du�rt��S�ztt|��}W�n>�tyh�}�z&d}t�||�j|��t��W��Y�d}~S�d}~0�0�|S�)z�Value of "Requires-Python:" in distribution metadata. If the key does not exist or contains an invalid value, an empty SpecifierSet should be returned. zRequires-PythonNz-Package %r has an invalid Requires-Python: %s)rG���rH���r ���r)���r���r;���r<���r-���)r���r#����specr=����messager ���r ���r!����requires_python����s����z BaseDistribution.requires_pythonr ���)�extrasr���c�����������������C���s ���t����dS�)z�Dependencies of this distribution. For modern .dist-info distributions, this is the collection of "Requires-Dist:" entries in distribution metadata. Nr���)r���rN���r ���r ���r!����iter_dependencies����s����z"BaseDistribution.iter_dependenciesc�����������������C���s ���t����dS�)z�Extras provided by this distribution. For modern .dist-info distributions, this is the collection of "Provides-Extra:" entries in distribution metadata. Nr���r���r ���r ���r!����iter_provided_extras����s����z%BaseDistribution.iter_provided_extrasN)r ���)'r%���r&���r'���r)���r0���r1���r(���r ���r/���r4���r5���r���r6����DistributionVersionr.���r���r2���r>���r?���r@���rA���rB���rC���r7���r���r���rF����emailrL���ZMessagerG���rI���r-���r ���rM���r���r���rO���rP���r ���r ���r ���r!���r*���8���sH��� r*���c�������������������@���s����e�Zd�ZdZed�d�dd��Zeeee��d�d�dd��Z eed�d �d d�Z ed�d�dd �Zed�d�dd�Z dedddfeee�eeeee�d�dd�ZdS�)�BaseEnvironmentz6An environment containing distributions to introspect.r���c�����������������C���s ���t����d�S�r���r���)�clsr ���r ���r!����default����s����zBaseEnvironment.default)�pathsr���c�����������������C���s ���t����d�S�r���r���)rT���rV���r ���r ���r!���� from_paths����s����zBaseEnvironment.from_pathsr*���rD���c�����������������C���s ���t����dS�)z=Given a requirement name, return the installed distributions.Nr���rE���r ���r ���r!����get_distribution����s����z BaseEnvironment.get_distributionc�����������������C���s ���t����dS�)a��Iterate through installed distributions. This function should be implemented by subclass, but never called directly. Use the public ``iter_distribution()`` instead, which implements additional logic to make sure the distributions are valid. Nr���r���r ���r ���r!����_iter_distributions����s����z#BaseEnvironment._iter_distributionsc�����������������c���sD���|�����D�]6}tjd|jtjd�}|s8t�d|j|j��q|V��qdS�)z(Iterate through installed distributions.z)^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$)�flagsz%Ignoring invalid distribution %s (%s)N)rY����re�matchr6���� IGNORECASEr;���r<���r/���)r���ZdistZproject_name_validr ���r ���r!����iter_distributions��s������z"BaseEnvironment.iter_distributionsTF)� local_only�skip�include_editables�editables_only� user_onlyr���c��������������������sb���|�����}|rdd��|D��}|s,dd��|D��}|r>dd��|D��}|rPdd��|D��}��fdd�|D��S�)a��Return a list of installed distributions. :param local_only: If True (default), only return installations local to the current virtualenv, if in a virtualenv. :param skip: An iterable of canonicalized project names to ignore; defaults to ``stdlib_pkgs``. :param include_editables: If False, don't report editables. :param editables_only: If True, only report editables. :param user_only: If True, only report installations in the user site directory. c�����������������s���s���|�]}|j�r|V��qd�S�r���)rA�����.0�dr ���r ���r!���� <genexpr>+�������z?BaseEnvironment.iter_installed_distributions.<locals>.<genexpr>c�����������������s���s���|�]}|j�s|V��qd�S�r����r@���rd���r ���r ���r!���rg���-��rh���c�����������������s���s���|�]}|j�r|V��qd�S�r���ri���rd���r ���r ���r!���rg���/��rh���c�����������������s���s���|�]}|j�r|V��qd�S�r���)rB���rd���r ���r ���r!���rg���1��rh���c�����������������3���s���|�]}|j���vr|V��qd�S�r���)r6���rd����r`���r ���r!���rg���2��rh���)r^���)r���r_���r`���ra���rb���rc����itr ���rj���r!����iter_installed_distributions��s����z,BaseEnvironment.iter_installed_distributionsN)r%���r&���r'����__doc__�classmethodrU���r ���r���r)���rW���rX���r���rY���r^���r���r?���r���r*���rl���r ���r ���r ���r!���rS�������s*��� ��rS���c�������������������@���s&���e�Zd�ZU�eed<�ejd�dd�ZdS�)�Wheelr/���r���c�����������������C���s ���t����d�S�r���r���r���r ���r ���r!���� as_zipfile8��s����zWheel.as_zipfileN)r%���r&���r'���r)����__annotations__�zipfile�ZipFilerp���r ���r ���r ���r!���ro���5��s��� ro���c�������������������@���s,���e�Zd�Zedd�dd�Zejd�dd�ZdS�)�FilesystemWheelN)r/���r���c�����������������C���s ���||�_�d�S�r���)r/���)r���r/���r ���r ���r!����__init__=��s����zFilesystemWheel.__init__r���c�����������������C���s���t�j|�jdd�S��NT)Z allowZip64)rr���rs���r/���r���r ���r ���r!���rp���@��s����zFilesystemWheel.as_zipfile)r%���r&���r'���r)���ru���rr���rs���rp���r ���r ���r ���r!���rt���<��s���rt���c�������������������@���s2���e�Zd�Zeee�dd�dd�Zejd�dd�Z dS�)�MemoryWheelN)r/����streamr���c�����������������C���s���||�_�||�_d�S�r���)r/���rx���)r���r/���rx���r ���r ���r!���ru���E��s����zMemoryWheel.__init__r���c�����������������C���s���t�j|�jdd�S�rv���)rr���rs���rx���r���r ���r ���r!���rp���I��s����zMemoryWheel.as_zipfile) r%���r&���r'���r)���r����bytesru���rr���rs���rp���r ���r ���r ���r!���rw���D��s���rw���)0Z email.messagerR���r:���Zloggingr[���rr����typingr���r���r���r���r���r���r���r ���r ���Z"pip._vendor.packaging.requirementsr���Z pip._vendor.packaging.specifiersr���r ���Zpip._vendor.packaging.utilsr���Zpip._vendor.packaging.versionr���r���Zpip._internal.models.direct_urlr���r���r���Zpip._internal.utils.compatr���Zpip._internal.utils.egg_linkr���Zpip._internal.utils.urlsr���r����objectrQ���Z getLoggerr%���r;���r���r*���rS���ro���rt���rw���r ���r ���r ���r!����<module>���s2���, �2L