관리-도구
편집 파일: specifiers.cpython-311.pyc
� ���-��,��Z�������������� �������������d�Z�ddlZddlZddlZddlmZmZmZmZm Z m Z mZmZm Z �ddlmZ�ddlmZ�e eef���������Z�ede�������������Zeeegef���������Zd ed efd�Z�G�d��d e������������Z�G�d��dej���������������������Z�G�d��de������������Z�ej��������d������������Zd ed ee���������fd�Zded efd�Z dee���������dee���������d eee���������ee���������f���������fd�Z!�G�d��de������������Z"dS�)z� .. testsetup:: from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier from packaging.version import Version �����N) �Callable�Iterable�Iterator�List�Optional�Set�Tuple�TypeVar�Union����)�canonicalize_version)�Version�UnparsedVersionVar)�bound�version�returnc������������������N�����t����������|�t����������������������st����������|�������������}�|�S��N)� isinstancer���)r���s��� �t/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/packaging/specifiers.py�_coerce_versionr���"���s&�������g�w�'�'��#��'�"�"���N�����c�������������������������e�Zd�ZdZdS�)�InvalidSpecifiera�� Raised when attempting to create a :class:`Specifier` with a specifier string that is invalid. >>> Specifier("lolwat") Traceback (most recent call last): ... packaging.specifiers.InvalidSpecifier: Invalid specifier: 'lolwat' N)�__name__� __module__�__qualname__�__doc__��r���r���r���r���(���s��������������������r���r���c������������ ������������e�Zd�Zej��������defd���������������Zej��������defd���������������Zej��������de de fd���������������Zeej��������de e ���������fd�����������������������������Zej��������de ddfd ���������������Zej��������dd ede e ���������de fd���������������Zej�������� �dd ee���������de e ���������dee���������fd���������������ZdS�)� BaseSpecifierr���c�����������������������dS�)z� Returns the str representation of this Specifier-like object. This should be representative of the Specifier itself. Nr�����selfs��� r����__str__zBaseSpecifier.__str__5�������������r���c�����������������������dS�)zF Returns a hash value for this Specifier-like object. Nr���r#���s��� r����__hash__zBaseSpecifier.__hash__<���r&���r����otherc�����������������������dS�)z� Returns a boolean representing whether or not the two Specifier-like objects are equal. :param other: The other object to check against. Nr����r$���r)���s��� r����__eq__zBaseSpecifier.__eq__B���r&���r���c�����������������������dS�)z�Whether or not pre-releases as a whole are allowed. This can be set to either ``True`` or ``False`` to explicitly enable or disable prereleases or it can be set to ``None`` (the default) to use default semantics. Nr���r#���s��� r����prereleaseszBaseSpecifier.prereleasesK���r&���r����valueNc�����������������������dS�)zQSetter for :attr:`prereleases`. :param value: The value to set. Nr����r$���r/���s��� r���r.���zBaseSpecifier.prereleasesT���r&���r����itemr.���c�����������������������dS�)zR Determines if the given item is contained within this specifier. Nr���)r$���r2���r.���s��� r����containszBaseSpecifier.contains[���r&���r����iterablec�����������������������dS�)z� Takes an iterable of items and filters them so that only items which are contained within this specifier are allowed in it. Nr���)r$���r5���r.���s��� r����filterzBaseSpecifier.filtera���r&���r���r���)r���r���r����abc�abstractmethod�strr%����intr(����object�boolr,����propertyr���r.����setterr4���r���r���r���r7���r���r���r���r!���r!���4���s����������������������������� ���#����������� � ���F���t����������������X�d�^������������X���������$������������ �����S���x��~�������������� � ��TX���� �!3�4��CK�D�>�� �$� %�������������r���r!���)� metaclassc������������ ������������e�Zd�ZdZdZdZ�ej��������dez���ez���dz���ej��������ej ��������z��������������Z dddd d ddd d�Zd1dede e���������ddfd�Zedefd���������������Zej��������deddfd���������������Zedefd���������������Zedefd���������������Zdefd�Zdefd�Zedeeef���������fd���������������Zdefd�Zdedefd�Zd edefd!�Zd"ededefd#�Z d"ededefd$�Z!d"ededefd%�Z"d"ededefd&�Z#d"ededefd'�Z$d"ed(edefd)�Z%d"ed(edefd*�Z&d"ededefd+�Z'd,e(eef���������defd-�Z) �d2d,e*de e���������defd.�Z+ �d2d/e,e-���������de e���������de.e-���������fd0�Z/dS�)3� Specifiera?��This class abstracts handling of version specifiers. .. tip:: It is generally not required to instantiate this manually. You should instead prefer to work with :class:`SpecifierSet` instead, which can parse comma-separated version specifiers (which is what package metadata contains). z8 (?P<operator>(~=|==|!=|<=|>=|<|>|===)) a��� (?P<version> (?: # The identity operators allow for an escape hatch that will # do an exact string match of the version you wish to install. # This will not be parsed by PEP 440 and we cannot determine # any semantic meaning from it. This operator is discouraged # but included entirely as an escape hatch. (?<====) # Only match for the identity operator \s* [^\s;)]* # The arbitrary version can be just about anything, # we match everything except for whitespace, a # semi-colon for marker support, and a closing paren # since versions can be enclosed in them. ) | (?: # The (non)equality operators allow for wild card and local # versions to be specified so we have to define these two # operators separately to enable that. (?<===|!=) # Only match for equals and not equals \s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)* # release # You cannot use a wild card and a pre-release, post-release, a dev or # local version together so group them with a | and make them optional. (?: \.\* # Wild card syntax of .* | (?: # pre release [-_\.]? (alpha|beta|preview|pre|a|b|c|rc) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local )? ) | (?: # The compatible operator requires at least two digits in the # release segment. (?<=~=) # Only match for the compatible operator \s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)+ # release (We have a + instead of a *) (?: # pre release [-_\.]? (alpha|beta|preview|pre|a|b|c|rc) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release ) | (?: # All other operators only allow a sub set of what the # (non)equality operators do. Specifically they do not allow # local versions to be specified nor do they allow the prefix # matching wild cards. (?<!==|!=|~=) # We have special cases for these # operators so we want to make sure they # don't match here. \s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)* # release (?: # pre release [-_\.]? (alpha|beta|preview|pre|a|b|c|rc) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release ) ) z^\s*z\s*$� compatible�equal� not_equal�less_than_equal�greater_than_equal� less_than�greater_than� arbitrary)�~=�==z!=�<=�>=�<�>�===��N�specr.���r���c����������������������|�j������������������������������|������������}|st����������d|��d��������������|���������������������d�����������������������������������������������|���������������������d�����������������������������������������������f|�_��������||�_��������dS�)a���Initialize a Specifier instance. :param spec: The string representation of a specifier which will be parsed and normalized before use. :param prereleases: This tells the specifier if it should accept prerelease versions if applicable or not. The default of ``None`` will autodetect it from the given specifiers. :raises InvalidSpecifier: If the given specifier is invalid (i.e. bad syntax). zInvalid specifier: '�'�operatorr���N)�_regex�searchr����group�strip�_spec�_prereleases)r$���rS���r.����matchs��� r����__init__zSpecifier.__init__����s����������"�"�4�(�(���� C�"�#A�$�#A�#A�#A�B�B�B�� �K�K� �#�#�)�)�+�+��K�K� �"�"�(�(�*�*�' �� ��(����r���c�����������������������|�j����������|�j���������S�|�j��������\��}}|dv�r;|dk����r|���������������������d������������r |d�d����������}t����������|������������j��������rdS�dS�)N)rL���rN���rM���rK���rQ���rL����.*���TF)r\���r[����endswithr���� is_prerelease)r$���rV���r���s��� r���r.���zSpecifier.prereleases���s|���������(��$�$� �!�J���'��6�6�6���4���G�$4�$4�T�$:�$:��!�#�2�#�,����w���-�� ��t��ur���r/���c�����������������������||�_���������d�S�r����r\���r1���s��� r���r.���zSpecifier.prereleases���������!����r���c�����������������������|�j���������d���������S�)z`The operator of this specifier. >>> Specifier("==1.2.3").operator '==' r����r[���r#���s��� r���rV���zSpecifier.operator�����������z�!�}�r���c�����������������������|�j���������d���������S�)zaThe version of this specifier. >>> Specifier("==1.2.3").version '1.2.3' r���rh���r#���s��� r���r���zSpecifier.version%��ri���r���c������������������l�����|�j���������� d|�j����������nd}d|�j��������j����������dt ����������|��������������|��d�S�)aT��A representation of the Specifier that shows all internal state. >>> Specifier('>=1.0.0') <Specifier('>=1.0.0')> >>> Specifier('>=1.0.0', prereleases=False) <Specifier('>=1.0.0', prereleases=False)> >>> Specifier('>=1.0.0', prereleases=True) <Specifier('>=1.0.0', prereleases=True)> N�, prereleases=rR���rO����(�)>)r\���r.���� __class__r���r:����r$����pres��� r����__repr__zSpecifier.__repr__.��sT�������� �,�� 2�T�-�1�1�1��� ��B�4�>�*�A�A�S��Y�Y�A�#�A�A�A�Ar���c������������������ ������dj���������|�j����������S�)z�A string representation of the Specifier that can be round-tripped. >>> str(Specifier('>=1.0.0')) '>=1.0.0' >>> str(Specifier('>=1.0.0', prereleases=False)) '>=1.0.0' z{}{})�formatr[���r#���s��� r���r%���zSpecifier.__str__@��s��������v�}�d�j�)�)r���c������������������v�����t����������|�j��������d���������|�j��������d���������dk�����������������}|�j��������d���������|fS�)Nr���r���rK�����strip_trailing_zero)r ���r[���)r$����canonical_versions��� r����_canonical_speczSpecifier._canonical_specJ��sB������0��J�q�M�!%��A��$�!6� �� �� ����z�!�}�/�/�/r���c������������������*�����t����������|�j��������������������S�r���)�hashry���r#���s��� r���r(���zSpecifier.__hash__R��s�������D�(�)�)�)r���r)���c�����������������������t����������|t����������������������r; �|����������������������t����������|������������������������}n3#�t����������$�r �t����������cY�S�w�xY�wt����������||�j��������������������st����������S�|�j��������|j��������k����S�)a>��Whether or not the two Specifier-like objects are equal. :param other: The other object to check against. The value of :attr:`prereleases` is ignored. >>> Specifier("==1.2.3") == Specifier("== 1.2.3.0") True >>> (Specifier("==1.2.3", prereleases=False) == ... Specifier("==1.2.3", prereleases=True)) True >>> Specifier("==1.2.3") == "==1.2.3" True >>> Specifier("==1.2.3") == Specifier("==1.2.4") False >>> Specifier("==1.2.3") == Specifier("~=1.2.3") False )r���r:���ro���r����NotImplementedry���r+���s��� r���r,���zSpecifier.__eq__U��s�������&��e�S�!�!�� "� &����s�5�z�z�2�2����#�� &�� &�� &�%�%�%�%� &�����E�4�>�2�2�� "�!�!��#�u�'<�<�<s����":��A� A�opc������������������B�����t����������|�d|�j��������|������������������������}|S�)N� _compare_)�getattr� _operators)r$���r~����operator_callables��� r���� _get_operatorzSpecifier._get_operatorr��s/������.5��3�d�o�b�1�3�3�/ ��/ ���!� r����prospectivec����������� �������&����d����������������������t����������t����������j��������t����������t����������|������������������������������������d�d����������������������}|dz ��}�|����������������������d������������||������������o�|����������������������d������������||������������S�)N�.���r`���rN���rL���)�join�list� itertools� takewhile�_is_not_suffix�_version_splitr����)r$���r����rS����prefixs��� r����_compare_compatiblezSpecifier._compare_compatiblex��s�������������$�^�^�D�5I�5I�J�J�K�K�C�R�C�P� �� �� � �$���'�t�!�!�$�'�'��T�:�:�� �?W�t�?Q�?Q�RV�?W�?W���@ ��@ �� r���c����������������������|����������������������d������������r}t����������|j��������d�������������}t����������|d�d����������d�������������}t����������|������������}t����������|������������}t ����������||������������\��}}|d�t����������|����������������������} | |k����S�t ����������|������������} | j��������st ����������|j��������������������}|| k����S�)Nr`���Frv���ra���)rb���r ����publicr�����_pad_version�lenr����local)r$���r����rS����normalized_prospective�normalized_spec� split_spec�split_prospective�padded_prospective�_�shortened_prospective�spec_versions��� r����_compare_equalzSpecifier._compare_equal���s���������=�=�����$ /�%9��"��&��&��&�"��3�4����9�RW�X�X�X�O��(��8�8�J� �!/�/E� F� F���%1�1B�J�$O�$O�!��� �%7�7H��Z���7H�$I�!�(�J�6�6��#�4�=�=�L� � �%�� :�%�k�&8�9�9���,�.�.r���c������������������0�����|�����������������������||�������������S�r���)r�����r$���r����rS���s��� r����_compare_not_equalzSpecifier._compare_not_equal���s�������&�&�{�D�9�9�9�9r���c������������������L�����t����������|j��������������������t����������|������������k����S�r����r���r����r����s��� r����_compare_less_than_equalz"Specifier._compare_less_than_equal���� ������ ��{�)�*�*�g�d�m�m�;�;r���c������������������L�����t����������|j��������������������t����������|������������k����S�r���r����r����s��� r����_compare_greater_than_equalz%Specifier._compare_greater_than_equal���r����r����spec_strc�����������������������t����������|������������}||k�����sdS�|j��������s3|j��������r,t����������|j��������������������t����������|j��������������������k����rdS�dS��NFT)r���rc����base_version�r$���r����r����rS���s��� r����_compare_less_thanzSpecifier._compare_less_than���sg��������x� � �� ��T�!�!��5���!�� �k�&?�� ��{�/�0�0�G�D�<M�4N�4N�N�N��u� ��tr���c����������������������t����������|������������}||k����sdS�|j��������s3|j��������r,t����������|j��������������������t����������|j��������������������k����rdS�|j���������,t����������|j��������������������t����������|j��������������������k����rdS�dS�r����)r����is_postreleaser����r����r����s��� r����_compare_greater_thanzSpecifier._compare_greater_than���s���������x� � �� ��T�!�!��5���"�� �{�'A�� ��{�/�0�0�G�D�<M�4N�4N�N�N��u����(��{�/�0�0�G�D�<M�4N�4N�N�N��u� ��tr���c�����������������������t����������|�����������������������������������������������t����������|�����������������������������������������������k����S�r���)r:����lowerr����s��� r����_compare_arbitraryzSpecifier._compare_arbitrary���s1�������;���%�%�'�'�3�t�9�9�?�?�+<�+<�<�<r���r2���c������������������,�����|�����������������������|������������S�)a;��Return whether or not the item is contained in this specifier. :param item: The item to check for. This is used for the ``in`` operator and behaves the same as :meth:`contains` with no ``prereleases`` argument passed. >>> "1.2.3" in Specifier(">=1.2.3") True >>> Version("1.2.3") in Specifier(">=1.2.3") True >>> "1.0.0" in Specifier(">=1.2.3") False >>> "1.3.0a1" in Specifier(">=1.2.3") False >>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True) True �r4����r$���r2���s��� r����__contains__zSpecifier.__contains__���������&��}�}�T�"�"�"r���c�����������������������|�|�j���������}t����������|������������}|j��������r|sdS�|����������������������|�j��������������������}�|||�j��������������������S�)al��Return whether or not the item is contained in this specifier. :param item: The item to check for, which can be a version string or a :class:`Version` instance. :param prereleases: Whether or not to match prereleases with this Specifier. If set to ``None`` (the default), it uses :attr:`prereleases` to determine whether or not prereleases are allowed. >>> Specifier(">=1.2.3").contains("1.2.3") True >>> Specifier(">=1.2.3").contains(Version("1.2.3")) True >>> Specifier(">=1.2.3").contains("1.0.0") False >>> Specifier(">=1.2.3").contains("1.3.0a1") False >>> Specifier(">=1.2.3", prereleases=True).contains("1.3.0a1") True >>> Specifier(">=1.2.3").contains("1.3.0a1", prereleases=True) True NF)r.���r���rc���r����rV���r���)r$���r2���r.����normalized_itemr����s��� r���r4���zSpecifier.contains��sg������8����*�K��*�$�/�/�� ��(�� ��� ��5��/3�.@�.@���.O�.O�� � ��$�,�?�?�?r���r5���c��������������#��������K����d}g�}d|�|ndi}|D�]K}t����������|������������}�|�j��������|fi�|��r,|j��������r|s|�j��������s|���������������������|��������������Ed}|V����L|s|r|D�] }|V����dS�dS�dS�)aO��Filter items in the given iterable, that match the specifier. :param iterable: An iterable that can contain version strings and :class:`Version` instances. The items in the iterable will be filtered according to the specifier. :param prereleases: Whether or not to allow prereleases in the returned iterator. If set to ``None`` (the default), it will be intelligently decide whether to allow prereleases or not (based on the :attr:`prereleases` attribute, and whether the only versions matching are prereleases). This method is smarter than just ``filter(Specifier().contains, [...])`` because it implements the rule from :pep:`440` that a prerelease item SHOULD be accepted if no other versions match the given specifier. >>> list(Specifier(">=1.2.3").filter(["1.2", "1.3", "1.5a1"])) ['1.3'] >>> list(Specifier(">=1.2.3").filter(["1.2", "1.2.3", "1.3", Version("1.4")])) ['1.2.3', '1.3', <Version('1.4')>] >>> list(Specifier(">=1.2.3").filter(["1.2", "1.5a1"])) ['1.5a1'] >>> list(Specifier(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True)) ['1.3', '1.5a1'] >>> list(Specifier(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"])) ['1.3', '1.5a1'] Fr.���NT)r���r4���rc���r.����append)r$���r5���r.����yielded�found_prereleases�kwr����parsed_versions��� r���r7���zSpecifier.filterE��s�����������<������K�,C�[�[�� N��� �� "�� "�G�,�W�5�5�N��t�}�^�2�2�r�2�2�� "��"�/��"��"�#'�#3�"��&�,�,�W�5�5�5�5��#�G�!�M�M�M�� ��� �,�� �,�� �� ��� � � � � �� �� �� � �� r����rR���Nr���)0r���r���r���r����_operator_regex_str�_version_regex_str�re�compile�VERBOSE� IGNORECASErW���r����r:���r���r=���r^���r>���r.���r?���rV���r���rr���r%���r ���ry���r;���r(���r<���r,����CallableOperatorr����r���r����r����r����r����r����r����r����r����r���r�����UnparsedVersionr4���r���r���r���r7���r���r���r���rB���rB���k���s/������������������\��|��R�Z��%�%�(:�:�W�D� � �R�]�"����F������"� � �� �� �J�(��(�S��(�H�T�N��(�d��(��(��(��(�4���T���������X��.���"���"�$��"��"��"����"����#���������X��������������X��B�#��B��B��B��B�$*���*��*��*��*���0��s�C�x���0��0��0���X�0�*�#��*��*��*��*�=�F��=�t��=��=��=��=�:!���!�(8��!��!��!��!� �w�� �c�� �d�� �� �� �� �*'/�'��'/���'/���'/��'/��'/��'/�R:�g��:�S��:�T��:��:��:��:�<�G��<�3��<�4��<��<��<��<�<�w��<�c��<�d��<��<��<��<��g���������������2����C���D���������>=�g��=�S��=�T��=��=��=��=�#��s�G�|�!4��#���#��#��#��#�,�DH�,@��,@�#�,@�2:�4�.�,@� �,@��,@��,@��,@�^�UY�;��;� �!3�4�;�CK�D�>�;� �$� %�;��;��;��;��;��;r���rB���z^([0-9]+)((?:a|b|c|rc)[0-9]+)$c������������������������g�}|�����������������������d������������D�][}t�������������������������������|������������}|r(|���������������������|�������������������������������������������������F|���������������������|��������������\|S�)Nr����)�split� _prefix_regexrX����extend�groupsr����)r����resultr2���r]���s��� r���r����r�������st�������F�� � �c�"�"�� �� ���$�$�T�*�*���� ��M�M�%�,�,�.�.�)�)�)�)��M�M�$������Mr����segmentc������������������<�������t������������fd�dD����������������������������S�)Nc��������������3����B����K����|�]}�����������������������|������������V����d�S�r���)� startswith)�.0r����r����s��� �r���� <genexpr>z!_is_not_suffix.<locals>.<genexpr>���sB���������������'-����6�"�"�����������r���)�dev�a�b�rc�post)�any)r����s���`r���r����r�������s@����������������1P�������������r����left�rightc������������������R����g�g�}}|����������������������t����������t����������j��������d��|��������������������������������������|����������������������t����������t����������j��������d��|�������������������������������������|����������������������|�t ����������|d���������������������d������������������������|����������������������|t ����������|d���������������������d������������������������|���������������������ddgt ����������dt ����������|d���������������������t ����������|d���������������������z ��������������z���������������|���������������������ddgt ����������dt ����������|d���������������������t ����������|d���������������������z ��������������z���������������t����������t����������j��������|��������������t����������t����������j��������|��������������fS�)Nc������������������*�����|�������������������������������������S�r�����isdigit��xs��� r����<lambda>z_pad_version.<locals>.<lambda>���s������������r���c������������������*�����|�������������������������������������S�r���r����r����s��� r���r����z_pad_version.<locals>.<lambda>���s������!�)�)�+�+��r���r���r����0)r����r����r����r����r�����insert�max�chain)r����r����� left_split�right_splits��� r���r����r�������sr����� �"��J�����d�9�.�/D�/D�d�K�K�L�L�M�M�M����t�I�/�0E�0E�u�M�M�N�N�O�O�O�����d�3�z�!�}�-�-�/�/�0�1�1�1����u�S��Q��0�0�2�2�3�4�4�4�����a�#���Q��K��N�(;�(;�c�*�Q�-�>P�>P�(P�!Q�!Q�Q�R�R�R����q�3�%�#�a��Z��]�);�);�c�+�a�.�>Q�>Q�)Q�"R�"R�R�S�S�S����*�-�.�.��Y�_�k�5R�0S�0S�T�Tr���c������������ ������������e�Zd�ZdZ �ddedee���������ddfd�Zedee���������fd���������������Z e j ��������d eddfd ���������������Z defd�Zdefd�Zde fd �Zded�ef���������dd�fd�Zdedefd�Zde fd�Zdee���������fd�Zdedefd�Z � �ddedee���������dee���������defd�Z �ddee���������dee���������dee���������fd�ZdS�)�SpecifierSetz�This class abstracts handling of a set of version specifiers. It can be passed a single specifier (``>=3.0``), a comma-separated list of specifiers (``>=3.0,!=3.1``), or no specifier at all. rR���N� specifiersr.���r���c������������������������d��|����������������������d������������D���������������}t������������������������}|D�]$}|���������������������t����������|��������������������������%t ����������|������������|�_��������||�_��������dS�)aN��Initialize a SpecifierSet instance. :param specifiers: The string representation of a specifier or a comma-separated list of specifiers which will be parsed and normalized before use. :param prereleases: This tells the SpecifierSet if it should accept prerelease versions if applicable or not. The default of ``None`` will autodetect it from the given specifiers. :raises InvalidSpecifier: If the given ``specifiers`` are not parseable than this exception will be raised. c������������������^�����g�|�]*}|�������������������������������������|��������������������������������������+S�r���)rZ����r�����ss��� r���� <listcomp>z)SpecifierSet.__init__.<locals>.<listcomp>���s-������R�R�R�!���� � �R�A�G�G�I�I�R�R�Rr����,N)r�����set�addrB���� frozenset�_specsr\���)r$���r����r.����split_specifiers�parsed� specifiers��� r���r^���zSpecifierSet.__init__���s������(�S�R�z�/?�/?��/D�/D�R�R�R���"%����)�� -�� -�I��J�J�y��+�+�,�,�,�,�� ��'�'����(����r���c������������������l�����|�j����������|�j���������S�|�j��������sd�S�t����������d��|�j��������D���������������������������S�)Nc��������������3����$���K����|�]}|j���������V����d�S�r����r.���r����s��� r���r����z+SpecifierSet.prereleases.<locals>.<genexpr>���s$����������6�6�Q�1�=�6�6�6�6�6�6r���)r\���r����r����r#���s��� r���r.���zSpecifierSet.prereleases���sH���������(��$�$� ��{�� ��4���6�6�$�+�6�6�6�6�6�6r���r/���c�����������������������||�_���������d�S�r���re���r1���s��� r���r.���zSpecifierSet.prereleases���rf���r���c������������������R�����|�j���������� d|�j����������nd}dt����������|��������������|��d�S�)a��A representation of the specifier set that shows all internal state. Note that the ordering of the individual specifiers within the set may not match the input string. >>> SpecifierSet('>=1.0.0,!=2.0.0') <SpecifierSet('!=2.0.0,>=1.0.0')> >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=False) <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=False)> >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=True) <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=True)> Nrl���rR���z<SpecifierSet(rn���)r\���r.���r:���rp���s��� r���rr���zSpecifierSet.__repr__���sF�������� �,�� 2�T�-�1�1�1��� ��5��D� � �4�S�4�4�4�4r���c������������������d�����d����������������������t����������d��|�j��������D���������������������������������������S�)an��A string representation of the specifier set that can be round-tripped. Note that the ordering of the individual specifiers within the set may not match the input string. >>> str(SpecifierSet(">=1.0.0,!=1.0.1")) '!=1.0.1,>=1.0.0' >>> str(SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False)) '!=1.0.1,>=1.0.0' r����c��������������3����4���K����|�]}t����������|������������V����d�S�r���)r:���r����s��� r���r����z'SpecifierSet.__str__.<locals>.<genexpr>��s(����������;�;�!�s�1�v�v�;�;�;�;�;�;r���)r�����sortedr����r#���s��� r���r%���zSpecifierSet.__str__���s/��������x�x��;�;�t�{�;�;�;�;�;�<�<�<r���c������������������*�����t����������|�j��������������������S�r���)r{���r����r#���s��� r���r(���zSpecifierSet.__hash__ ��s�������D�K� � � r���r)���c����������������������t����������|t����������������������rt����������|������������}nt����������|t����������������������st����������S�t������������������������}t ����������|�j��������|j��������z��������������|_��������|�j���������|j��������� |j��������|_��������nG|�j���������|j��������� |�j��������|_��������n,|�j��������|j��������k����r |�j��������|_��������nt����������d�������������|S�)a���Return a SpecifierSet which is a combination of the two sets. :param other: The other object to combine with. >>> SpecifierSet(">=1.0.0,!=1.0.1") & '<=2.0.0,!=2.0.1' <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')> >>> SpecifierSet(">=1.0.0,!=1.0.1") & SpecifierSet('<=2.0.0,!=2.0.1') <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')> NzFCannot combine SpecifierSets with True and False prerelease overrides.)r���r:���r����r}���r����r����r\���� ValueError)r$���r)���r����s��� r����__and__zSpecifierSet.__and__ ��s���������e�S�!�!�� "� ��'�'�E�E��E�<�0�0�� "�!�!� �N�N� �$�T�[�5�<�%?�@�@� ����$��);�)G�%*�%7�I�"�"� � � *�u�/A�/I�%)�%6�I�"�"� � �%�"4� 4� 4�%)�%6�I�"�"������� � ��r���c������������������������t����������|t����������t����������f������������rt����������t����������|������������������������}nt����������|t����������������������st����������S�|�j��������|j��������k����S�)a���Whether or not the two SpecifierSet-like objects are equal. :param other: The other object to check against. The value of :attr:`prereleases` is ignored. >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.1") True >>> (SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False) == ... SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)) True >>> SpecifierSet(">=1.0.0,!=1.0.1") == ">=1.0.0,!=1.0.1" True >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0") False >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.2") False )r���r:���rB���r����r}���r����r+���s��� r���r,���zSpecifierSet.__eq__-��sW������&��e�c�9�-�.�.�� "� ��U���,�,�E�E��E�<�0�0�� "�!�!��{�e�l�*�*r���c������������������*�����t����������|�j��������������������S�)z7Returns the number of specifiers in this specifier set.)r����r����r#���s��� r����__len__zSpecifierSet.__len__G��s�������4�;���r���c������������������*�����t����������|�j��������������������S�)z� Returns an iterator over all the underlying :class:`Specifier` instances in this specifier set. >>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str) [<Specifier('!=1.0.1')>, <Specifier('>=1.0.0')>] )�iterr����r#���s��� r����__iter__zSpecifierSet.__iter__K��s��������D�K� � � r���r2���c������������������,�����|�����������������������|������������S�)ar��Return whether or not the item is contained in this specifier. :param item: The item to check for. This is used for the ``in`` operator and behaves the same as :meth:`contains` with no ``prereleases`` argument passed. >>> "1.2.3" in SpecifierSet(">=1.0.0,!=1.0.1") True >>> Version("1.2.3") in SpecifierSet(">=1.0.0,!=1.0.1") True >>> "1.0.1" in SpecifierSet(">=1.0.0,!=1.0.1") False >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1") False >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True) True r����r����s��� r���r����zSpecifierSet.__contains__U��r����r���� installedc��������������������������t�����������t����������������������st��������������������������|�j����������s �j��������rdS�|r�j��������rt�����������j���������������������t������������fd�|�j��������D���������������������������S�)a���Return whether or not the item is contained in this SpecifierSet. :param item: The item to check for, which can be a version string or a :class:`Version` instance. :param prereleases: Whether or not to match prereleases with this SpecifierSet. If set to ``None`` (the default), it uses :attr:`prereleases` to determine whether or not prereleases are allowed. >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.2.3") True >>> SpecifierSet(">=1.0.0,!=1.0.1").contains(Version("1.2.3")) True >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.0.1") False >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1") False >>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True).contains("1.3.0a1") True >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True) True NFc��������������3����F����K����|�]}|��������������������������������������V����dS�)r����Nr����)r����r����r2���r.���s��� ��r���r����z(SpecifierSet.contains.<locals>.<genexpr>���s3�����������R�R��1�:�:�d��:�<�<�R�R�R�R�R�Rr���)r���r���r.���rc���r�����allr����)r$���r2���r.���r��s��� `` r���r4���zSpecifierSet.containsj��s���������<��$��(�(�� !��4�=�=�D� ����*�K���� �t�1�� ��5��� .��+�� .��4�,�-�-�D���R�R�R�R�R�d�k�R�R�R�R�R�Rr���r5���c����������������������|�|�j���������}|�j��������r=|�j��������D�]&}|���������������������|t����������|�������������������������}�'t ����������|������������S�g�}g�}|D�]G}t����������|������������}|j��������r|s|s|���������������������|��������������2|���������������������|��������������H|s|r|�t ����������|������������S�t ����������|������������S�)a.��Filter items in the given iterable, that match the specifiers in this set. :param iterable: An iterable that can contain version strings and :class:`Version` instances. The items in the iterable will be filtered according to the specifier. :param prereleases: Whether or not to allow prereleases in the returned iterator. If set to ``None`` (the default), it will be intelligently decide whether to allow prereleases or not (based on the :attr:`prereleases` attribute, and whether the only versions matching are prereleases). This method is smarter than just ``filter(SpecifierSet(...).contains, [...])`` because it implements the rule from :pep:`440` that a prerelease item SHOULD be accepted if no other versions match the given specifier. >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", "1.5a1"])) ['1.3'] >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", Version("1.4")])) ['1.3', <Version('1.4')>] >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.5a1"])) [] >>> list(SpecifierSet(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True)) ['1.3', '1.5a1'] >>> list(SpecifierSet(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"])) ['1.3', '1.5a1'] An "empty" SpecifierSet will filter items based on the presence of prerelease versions in the set. >>> list(SpecifierSet("").filter(["1.3", "1.5a1"])) ['1.3'] >>> list(SpecifierSet("").filter(["1.5a1"])) ['1.5a1'] >>> list(SpecifierSet("", prereleases=True).filter(["1.3", "1.5a1"])) ['1.3', '1.5a1'] >>> list(SpecifierSet("").filter(["1.3", "1.5a1"], prereleases=True)) ['1.3', '1.5a1'] Nr����)r.���r����r7���r=���r��r���rc���r����)r$���r5���r.���rS����filteredr����r2���r����s��� r���r7���zSpecifierSet.filter���s�������X����*�K� ��;�� "���� P�� P���;�;�x�T�+�=N�=N�;�O�O�����>�>�!� �24�H�:<�� �� *�� *��!0��!6�!6���"�/��*���*�#��7�)�0�0��6�6�6���O�O�D�)�)�)�)���� /� 1�� /�k�6I��-�.�.�.���>�>�!r���r����)NNr���)r���r���r���r���r:���r���r=���r^���r>���r.���r?���rr���r%���r;���r(���r���r��r<���r,���r ��r���rB���r ��r����r����r4���r���r���r7���r���r���r���r����r�������s`�����������������CG�!(��!(��!(�19�$��!(� �!(��!(��!(��!(�F��7�X�d�^��7��7��7���X�7� ���"���"�$��"��"��"����"�5�#��5��5��5��5�*=���=��=��=��=�!�#��!��!��!��!��U�>�3�#6�7���N���������@+�F��+�t��+��+��+��+�4 ��� �� �� �� �!�(�9�-��!��!��!��!�#���#�T��#��#��#��#�0�'+�$(� 7S��7S��7S���d�^�7S���D�>� 7S� � �7S��7S��7S��7S�t�UY�M"��M"� �!3�4�M"�CK�D�>�M"� �$� %�M"��M"��M"��M"��M"��M"r���r����)#r���r8���r����r�����typingr���r���r���r���r���r���r ���r ���r����utilsr ���r���r���r:���r����r���r=���r����r���r��r����ABCMetar!���rB���r����r����r����r����r����r����r���r���r����<module>r�����s���������� � � ���������� � � � � �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��(��'��'��'��'��'�����������������%���W�1��I�I�I����W�c�N�D�0�1����_������������ �� �� �� �� �z�� �� �� �4��4��4��4��4�c�k��4��4��4��4�nU��U��U��U��U� ��U��U��U�p��� �<�=�=� ��C���D��I����������C���D���������U�t�C�y��U��c���U�u�T�#�Y��S� �=Q�7R��U��U��U��U�$G"��G"��G"��G"��G"�=��G"��G"��G"��G"��G"r���