o
    j<                     @  s  d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z ejr3ddlZddlmZ eeZdZede d ejejB ZdXddZdZede dejZdYddZzzddlmZ W n eyw   ddl mZ Y nw dZddZ!W n ey   e"d dZddZ!Y nw dZddZ#dZddZ$d[dd Z%G d!d" d"Z&zdd#l'm(Z) dZd$d%Z*W n ey   e& Z*Y nw dZd&d'Z+dZd(d)Z,d*Z-ede- dejZ.d+Z/ede/ dejZ0d,Z1ede1 dejZ2dZd-d.Z3dZd/d0Z4dZd1d2Z5dZd3d4Z6dZd5d6Z7dZd7d8Z8dZd9d:Z9d\d<d=Z:d\d>d?Z;d\d@dAZ<d\dBdCZ=d\dDdEZ>d\dFdGZ?d\dHdIZ@d\dJdKZAd\dLdMZBd\dNdOZCzddPlmDZE dZdQdRZFW n eyi   e"dS dZdTdRZFY nw edUejZGdZdVdWZHdS )]a@  
The functions in this module are used to validate schemas with the
`format JSON Schema keyword
<https://json-schema.org/understanding-json-schema/reference/string#format>`_.

The correspondence is given by replacing the ``_`` character in the name of the
function with a ``-`` to obtain the format name and vice versa.
    )annotationsN)chain)Literala  
    v?
    (?:
        (?:(?P<epoch>[0-9]+)!)?                           # epoch
        (?P<release>[0-9]+(?:\.[0-9]+)*)                  # release segment
        (?P<pre>                                          # pre-release
            [-_\.]?
            (?P<pre_l>alpha|a|beta|b|preview|pre|c|rc)
            [-_\.]?
            (?P<pre_n>[0-9]+)?
        )?
        (?P<post>                                         # post release
            (?:-(?P<post_n1>[0-9]+))
            |
            (?:
                [-_\.]?
                (?P<post_l>post|rev|r)
                [-_\.]?
                (?P<post_n2>[0-9]+)?
            )
        )?
        (?P<dev>                                          # dev release
            [-_\.]?
            (?P<dev_l>dev)
            [-_\.]?
            (?P<dev_n>[0-9]+)?
        )?
    )
    (?:\+(?P<local>[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
z^\s*z\s*$versionstrreturnboolc                 C     t | duS )zpSee :ref:`PyPA's version specification <pypa:version-specifiers>`
    (initially introduced in :pep:`440`).
    N)VERSION_REGEXmatch)r    r   n/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/setuptools/config/_validate_pyproject/formats.pypep440B      r   z'([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])^$namec                 C  r	   )zlSee :ref:`PyPA's name specification <pypa:name-format>`
    (initially introduced in :pep:`508#names`).
    N)PEP508_IDENTIFIER_REGEXr   )r   r   r   r   pep508_identifierP   r   r   )requirementsvaluec                 C  (   zt |  W dS  t jy   Y dS w )z{See :ref:`PyPA's dependency specifiers <pypa:dependency-specifiers>`
        (initially introduced in :pep:`508`).
        FT)_reqRequirementInvalidRequirementr   r   r   r   pep508`      r   zCould not find an installation of `packaging`. Requirements, dependencies and versions might not be validated. To enforce validation, please install `packaging`.c                 C     dS NTr   r   r   r   r   r   q      c                   s(   t  fdddD rdS td  S )zExpression that can be used to specify/lock versions (including ranges)
    See ``versionspec`` in :ref:`PyPA's dependency specifiers
    <pypa:dependency-specifiers>` (initially introduced in :pep:`508`).
    c                 3  s    | ]}| v V  qd S Nr   ).0cr   r   r   	<genexpr>z       z%pep508_versionspec.<locals>.<genexpr>);]@Frequirement)anyr   r   r   r   r   pep508_versionspecu   s   r+   c                 C  sB   |  d\}}}dd t|d|dD }tdd |D S )zSee PyPA's specification for defining build-backend references
    introduced in :pep:`517#source-trees`.

    This is similar to an entry-point reference (e.g., ``package.module:object``).
    :c                 s      | ]}|  V  qd S r!   stripr"   ir   r   r   r$      r%   z+pep517_backend_reference.<locals>.<genexpr>.c                 s  s    | ]	}|rt |V  qd S r!   python_identifierr0   r   r   r   r$          )	partition_chainsplitall)r   module_objidentifiersr   r   r   pep517_backend_reference   s    r>   c                  C  s   dd l } ddlm} ddlm} d}|  }|||d}| }|dd|d< | |	d	d
W  d    S 1 s=w   Y  d S )Nr   )Message)urlopenz.https://pypi.org/pypi?:action=list_classifiers)contextzcontent-typez
text/plaincontent_typecharsetzutf-8)
sslemail.messager?   urllib.requestr@   create_default_context	getheaderreaddecode	get_param)rD   r?   r@   urlrA   responseheadersr   r   r   _download_classifiers   s   $rO   c                   @  s:   e Zd ZU dZded< 	 dddZddd	ZdddZdS )_TroveClassifierak  The ``trove_classifiers`` package is the official way of validating classifiers,
    however this package might not be always available.
    As a workaround we can still download a list from PyPI.
    We also don't want to be over strict about it, so simply skipping silently is an
    option (classifiers will be validated anyway during the upload to PyPI).
    z None | Literal[False] | set[str]
downloadedr   Nonec                 C  s   d | _ d| _d| _d S )NFtrove_classifier)rQ   _skip_download__name__selfr   r   r   __init__   s   
z_TroveClassifier.__init__c                 C  s
   d| _ d S r   )rT   rV   r   r   r   _disable_download   s   
z"_TroveClassifier._disable_downloadr   r   r   c                 C  s   | j du s
| jdu rdS tdstdr"d| _ d}t| dS | j d u rKd}t| z
tt  | _ W n t	yJ   d| _ td Y dS w || j v pV|
 dS )	NFTZ
NO_NETWORKZVALIDATE_PYPROJECT_NO_NETWORKzxInstall ``trove-classifiers`` to ensure proper validation. Skipping download of classifiers list from PyPI (NO_NETWORK).zxInstall ``trove-classifiers`` to ensure proper validation. Meanwhile a list of classifiers will be downloaded from PyPI.z*Problem with download, skipping validation
private ::)rQ   rT   osgetenv_loggerdebugsetrO   
splitlines	Exceptionlower
startswith)rW   r   msgr   r   r   __call__   s(   



z_TroveClassifier.__call__N)r   rR   r   r   r   r   )rU   
__module____qualname____doc____annotations__rX   rY   re   r   r   r   r   rP      s   
 

rP   )classifiersc                 C  s   | t v p
|  dS )z!See https://pypi.org/classifiers/rZ   )_trove_classifiersrb   rc   r   r   r   r   rS      s   rS   c                 C  s>   |  d^}}|dsdS td|dtd  g|S )zName of a directory containing type stubs.
    It must follow the name scheme ``<package>-stubs`` as defined in
    :pep:`561#stub-only-packages`.
    r2   -stubsFN)r8   endswithpython_module_namejoinlen)r   topchildrenr   r   r   pep561_stub_name   s   
"rt   c                 C  sr   ddl m} z(|| }|js&td|   | ds&d| v s&|d|  }t|jo,|jW S  ty8   Y dS w )zValid URL (validation uses :obj:`urllib.parse`).
    For maximum compatibility please make sure to include a ``scheme`` prefix
    in your URL (e.g. ``http://``).
    r   )urlparsezsFor maximum compatibility please make sure to include a `scheme` prefix in your URL (e.g. 'http://'). Given value: )/\r(   zhttp://F)	urllib.parseru   schemer]   warningrc   r   netlocra   )r   ru   partsr   r   r   rL      s   rL   z[^\[\s=]([^=]*[^\s=])?z[\w.-]+z\w+(\.\w+)*c                 C  s   |   S )zXCan be used as identifier in Python.
    (Validation uses :obj:`str.isidentifier`).
    )isidentifierr   r   r   r   r4        r4   c                 C  s0   |  ds
| drdS tdd | dD S )z
    Python "dotted identifier", i.e. a sequence of :obj:`python_identifier`
    concatenated with ``"."`` (e.g.: ``package.module.submodule``).
    r2   Fc                 s      | ]}t |V  qd S r!   r3   )r"   mr   r   r   r$   '  r%   z.python_qualified_identifier.<locals>.<genexpr>)rc   rn   r9   r8   r   r   r   r   python_qualified_identifier   s   r   c                 C  s   t | S )zsModule name that can be used in an ``import``-statement in Python.
    See :obj:`python_qualified_identifier`.
    )r   r   r   r   r   ro   *  r~   ro   c                 C  s6   |  ds
| drdS | drdS t| ddS )a  Similar to :obj:`python_module_name`, but relaxed to also accept
    dash characters (``-``) and cover special cases like ``pip-run``.

    It is recommended, however, that beginners avoid dash characters,
    as they require advanced knowledge about Python internals.

    The following are disallowed:

    * names starting/ending in dashes,
    * names ending in ``-stubs`` (potentially collide with :obj:`pep561_stub_name`).
    -Frm   r;   )rc   rn   ro   replacer   r   r   r   python_module_name_relaxed1  s
   
r   c                 C  r	   )zhSee ``Data model > group`` in the :ref:`PyPA's entry-points specification
    <pypa:entry-points>`.
    N)ENTRYPOINT_GROUP_REGEXr   r   r   r   r   python_entrypoint_groupD  r   r   c                 C  s:   t | sdS t| sd|  d}|t7 }t| dS )zgSee ``Data model > name`` in the :ref:`PyPA's entry-points specification
    <pypa:entry-points>`.
    FzEntry point `z'` does not follow recommended pattern: T)ENTRYPOINT_REGEXr   RECOMMEDED_ENTRYPOINT_REGEXRECOMMEDED_ENTRYPOINT_PATTERNr]   rz   )r   rd   r   r   r   python_entrypoint_nameK  s   


r   c           	      C  s   |  d\}}}d|v rC| d\}}}| d dkrdS dd |tjd d	D }td
d |D s9dS td|  d n|}|d}|rTt||dnt	|}tdd |D S )zReference to a Python object using in the format::

        importable.module:object.attr

    See ``Data model >object reference`` in the :ref:`PyPA's entry-points specification
    <pypa:entry-points>`.
    r,   [r'   Fc                 s  r-   r!   r.   )r"   xr   r   r   r$   e  r%   z.python_entrypoint_reference.<locals>.<genexpr>z[],c                 s  r   r!   )r   )r"   er   r   r   r$   f  r%   `z4` - using extras for entry points is not recommendedr2   c                 s  s    | ]	}t | V  qd S r!   )r4   r/   r0   r   r   r   r$   n  r5   )
r6   r/   string
whitespacer8   r9   r]   rz   r7   iter)	r   r:   r;   restr<   Zextras_extrasmodule_partsr=   r   r   r   python_entrypoint_referenceX  s    
r   builtins.intc                 C     d|   ko	dk S   S )z/Unsigned 8-bit integer (:math:`0 \leq x < 2^8`)r      r   r   r   r   r   uint8q     r   c                 C  r   )z3Unsigned 16-bit integer (:math:`0 \leq x < 2^{16}`)r   i   r   r   r   r   r   uint16v  r   r   c                 C  r   )z3Unsigned 32-bit integer (:math:`0 \leq x < 2^{32}`)r   l        r   r   r   r   r   uint32{  r   r   c                 C  r   )z3Unsigned 64-bit integer (:math:`0 \leq x < 2^{64}`)r               r   r   r   r   r   uint64  r   r   c                 C  r   )z1Signed 64-bit integer (:math:`0 \leq x < 2^{64}`)r   r   r   r   r   r   r   uint  r   r   c                 C  r   )z4Signed 8-bit integer (:math:`-2^{7} \leq x < 2^{7}`)i   r   r   r   r   r   int8  r   r   c                 C  r   )z7Signed 16-bit integer (:math:`-2^{15} \leq x < 2^{15}`)i i   r   r   r   r   r   int16  r   r   c                 C  r   )z7Signed 32-bit integer (:math:`-2^{31} \leq x < 2^{31}`)i   l        r   r   r   r   r   int32  r   r   c                 C  r   z7Signed 64-bit integer (:math:`-2^{63} \leq x < 2^{63}`)l         l            r   r   r   r   r   int64  r   r   c                 C  r   r   r   r   r   r   r   int  r   r   )licensesc                 C  r   )zSee :ref:`PyPA's License-Expression specification
        <pypa:core-metadata-license-expression>` (added in :pep:`639`).
        FT)	_licensesZcanonicalize_license_expressionZInvalidLicenseExpressionr   r   r   r   SPDX  r   r   zCould not find an up-to-date installation of `packaging`. License expressions might not be validated. To enforce validation, please install `packaging>=24.2`.c                 C  r   r   r   r   r   r   r   r     r    aP  
    ^                                  # start of string
        [A-Za-z_][A-Za-z_0-9]+         # a valid Python identifier
        (?:\.[A-Za-z_][A-Za-z_0-9]*)*  # optionally followed by .identifier's
    (?:\s*;\s*private)?                # optionally followed by ; private
    $                                  # end of string
    c                 C  s>   t | du r	dS | d\}}}tdd | dD S )zThis is a valid import name. It has to be series of python identifiers
    (not keywords), separated by dots, optionally followed by a semicolon and
    the keyword "private".
    NFr&   c                 s  s    | ]	}t | V  qd S r!   )keyword	iskeyword)r"   identr   r   r   r$     r5   zimport_name.<locals>.<genexpr>r2   )VALID_IMPORT_NAMEr   r6   r9   rstripr8   )r   Zidentsr;   r   r   r   import_name  s   r   )r   r   r   r   )r   r   r   r   rf   )r   r   )r   r   r   r   )Iri   
__future__r   r   loggingr[   rer   typing	itertoolsr   r7   TYPE_CHECKINGbuiltinsZtyping_extensionsr   	getLoggerrU   r]   VERSION_PATTERNcompileVERBOSE
IGNORECASEr
   r   ZPEP508_IDENTIFIER_PATTERNr   r   	packagingr   r   ImportErrorZsetuptools._vendor.packagingr   rz   r+   r>   rO   rP   Ztrove_classifiersrk   rl   rS   rt   rL   ZENTRYPOINT_PATTERNr   r   r   ZENTRYPOINT_GROUP_PATTERNr   r4   r   ro   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>   s    	







5





















