관리-도구
편집 파일: constructors.cpython-311.pyc
� �Re�; � � � d Z ddlZddlZddlZddlmZmZmZmZm Z m Z ddlmZ ddl mZmZ ddlmZ ddlmZmZ ddlmZ dd lmZmZ dd lmZ ddlmZ ddlmZ dd l m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+m,Z, g d�Z- ej. e/� � Z0ej1 �2 � � Z3de4de e4ee4 f fd�Z5dee4 dee4 fd�Z6de4de ee4 e4ee4 f fd�Z7de4de4fd�Z8 G d� d� � Z9de4de9fd�Z: d6de4d!ee e!e4f d"ee; d#e;d$eee4ef d%e;d&e;d'e;de!fd(�Z<d)e4de;fd*�Z=de4d)e4dee4 fd+�Z>d)e4d,ee4 de9fd-�Z? d7d)e4d!ee e4e!f d"ee; d#e;d$eee4ef d%e;d,ee4 d&e;de!fd.�Z@ d8d/e4d!ee! d#e;d"ee; d&e;de!fd0�ZA d9d1ed#e;d"ee; d&e;de!f d2�ZBd3ed4e!de!fd5�ZCdS ):a~ Backing implementation for InstallRequirement's various constructors The idea here is that these formed a major chunk of InstallRequirement's size so, moving them and support code dedicated to them outside of that class helps creates for better understandability for the rest of the code. These are meant to be used elsewhere within pip to create instances of InstallRequirement. � N)�Any�Dict�Optional�Set�Tuple�Union)�Marker)�InvalidRequirement�Requirement)� Specifier)�RequirementParseError�parse_requirements)�InstallationError)�PyPI�TestPyPI)�Link)�Wheel)�ParsedRequirement)�InstallRequirement)�is_archive_file)�is_installable_dir)�get_requirement)�path_to_url)�is_url�vcs)�install_req_from_editable�install_req_from_line�parse_editable�path�returnc � � t j d| � � }d }|r+|� d� � }|� d� � }n| }||fS )Nz^(.+)(\[[^\]]+\])$� � )�re�match�group)r �m�extras�path_no_extrass ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-3.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_internal/req/constructors.py� _strip_extrasr+ + sQ � � ��&��-�-�A� �F�� �������������������6�!�!� r( c �t � | st � � S t d| � � � z � � j S )N�placeholder)�setr �lowerr( )r( s r* �convert_extrasr1 7 s1 � �� ��u�u���=�6�<�<�>�>�9�:�:�A�Ar, �editable_reqc � � | }t |� � \ }}t j � |� � rt |� � }|� � � � d� � rSt |� � j }|r,||t d|� � � z � � j fS ||t � � fS t D ]5}|� � � � |� d�� � r |� d|� �} n�6t |� � }|j s4d� t j � � }t! | � d|� d�� � �|j }|s"t! d� | � � � � �||t � � fS ) a Parses an editable requirement into: - a requirement name - an URL - extras - editable options Accepted requirements: svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version_subdir .[some_extra] zfile:r. �:�+z, zq is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with z).zZCould not detect requirement name for '{}', please specify one with #egg=your_package_name)r+ �osr �isdirr r0 � startswithr �egg_fragmentr r( r/ r �is_vcs�join�all_schemesr �format)r2 �url� url_no_extrasr( �package_name�version_control�link�backendss r* r r = s� � � �C� *�#�.�.��M�6� �w�}�}�]�#�#� 3�#�M�2�2� ������'�'��0�0� 6��M�*�*�7��� 6���� ������ >�?�?�F�� � �����5�5�� � ���9�9�;�;�!�!�_�"7�"7�"7�8�8� �$�,�,�s�,�,�C��E� � ��9�9�D��;� ��9�9�S�_�-�-���� ,� ,�'� ,� ,� ,� � � � �$�L�� �� *�*0�&��*>�*>� � � � ��c�e�e�#�#r, �reqc � � d}t j � | � � r�d} t | � � 5 }t t |� � � � � � � |d� | � � z }ddd� � n# 1 swxY w Y n6# t $ r t � d| d�� � Y n w xY w|d| � d �z }|S ) z�Returns helpful msg in case requirements file does not exist, or cannot be parsed. :params req: Requirements file path � z The path does exist. z�The argument you provided ({}) appears to be a requirements file. If that is the case, use the '-r' flag to install the packages specified within it.Nz&Cannot parse '%s' as requirements fileT)�exc_infoz File 'z' does not exist.)r6 r �exists�open�nextr �readr= r �logger�debug)rD �msg�fps r* �deduce_helpful_msgrP t s" � � �C� �w�~�~�c��� 0�&�� W��c��� �b��'���� � �2�2�3�3�3��9� �&��+�+� �� � � � � � � � � � � ���� � � � ��� %� W� W� W��L�L�A�3�QU�L�V�V�V�V�V� W���� �/��/�/�/�/���Js5 �B �AB�;B �B�B �B�B �'B=�<B=c �V � e Zd Zdee dee dee dee fd�Z dS )�RequirementParts�requirementrB �markersr( c �>