
    ϶vg2                        d 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
        rddlmZ  ej        e          ZdZ ej        dez   dz   ej        ej        z            Zded	efd
ZdZ ej        de dej                  Zded	efdZ	 	 ddlmZ n# e$ r	 ddlmZ Y nw xY wded	efdZ n(# e$ r  e!                    d           ded	efdZ Y nw xY wded	efdZ"ded	efdZ#d	efdZ$ G d d          Z%	 ddl&m'Z( ded	efdZ)n# e$ r  e%            Z)Y nw xY wded	efdZ*ded	efdZ+dZ, ej        de, dej                  Z-dZ. ej        de. dej                  Z/d Z0 ej        de0 dej                  Z1ded	efd!Z2ded	efd"Z3ded	efd#Z4ded	efd$Z5ded	efd%Z6ded	efd&Z7ded	efd'Z8dej9        d	efd(Z:dej9        d	efd)Z;dej9        d	efd*Z<dej9        d	efd+Z9d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.
    N)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returnc                 :    t                               |           duS )zpSee :ref:`PyPA's version specification <pypa:version-specifiers>`
    (initially introduced in :pep:`440`).
    N)VERSION_REGEXmatch)r   s    j/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/setuptools/config/_validate_pyproject/formats.pypep440r   <   s     w''t33    z'([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])^$namec                 :    t                               |           duS )zlSee :ref:`PyPA's name specification <pypa:name-format>`
    (initially introduced in :pep:`508#names`).
    N)PEP508_IDENTIFIER_REGEXr	   )r   s    r
   pep508_identifierr   J   s     #((..d::r   )requirementsvaluec                 \    	 t          j        |            dS # t           j        $ r Y dS w xY w)z{See :ref:`PyPA's dependency specifiers <pypa:dependency-specifiers>`
        (initially introduced in :pep:`508`).
        TF)_reqRequirementInvalidRequirementr   s    r
   pep508r   Z   sB    	U###4& 	 	 	55	s    ++zCould not find an installation of `packaging`. Requirements, dependencies and versions might not be validated. To enforce validation, please install `packaging`.c                     dS NT r   s    r
   r   r   k   s    tr   c                 b     t           f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       K   | ]}|v V  	d S Nr   ).0cr   s     r
   	<genexpr>z%pep508_versionspec.<locals>.<genexpr>t   s'      
/
/!1:
/
/
/
/
/
/r   );]@Frequirement)anyr   r   s   `r
   pep508_versionspecr)   o   sJ    
 
/
/
/
/
/
/
///  u '''(((r   c                     |                      d          \  }}}d t          |                    d          |                    d                    D             }t          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              3   >   K   | ]}|                                 V  d S r    stripr!   is     r
   r#   z+pep517_backend_reference.<locals>.<genexpr>   s*      PP17799PPPPPPr   .c              3   8   K   | ]}|t          |          V  d S r    python_identifierr/   s     r
   r#   z+pep517_backend_reference.<locals>.<genexpr>   s0      >>A> ##>>>>>>r   )	partition_chainsplitall)r   module_objidentifierss        r
   pep517_backend_referencer=      sk     __S))NFAsPPfV\\#->->		#&O&OPPPK>>[>>>>>>r   c                  X   dd l } ddlm} ddlm} d}|                                 } |||          5 } |            }|                    dd          |d<   |                                                    |	                    d	d
                    cd d d            S # 1 swxY 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headerss          r
   _download_classifiersrO      s   JJJ%%%%%%&&&&&&
:C((**G	g	&	&	& M('))"*"4"4^\"R"R}}%%g&7&7	7&K&KLLM M M M M M M M M M M M M M M M M Ms   ABB#&B#c                   p    e Zd ZU dZej        ddej        e         f         ed<   d
dZ	d
dZ
dedef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).
    NzLiteral[False]
downloadedr   c                 0    d | _         d| _        d| _        d S )NFtrove_classifier)rR   _skip_download__name__selfs    r
   __init__z_TroveClassifier.__init__   s    # +r   c                     d| _         d S r   )rU   rW   s    r
   _disable_downloadz"_TroveClassifier._disable_download   s    "r   r   c                 6   | j         du s	| j        du rdS t          j        d          st          j        d          r%d| _         d}t                              |           dS | j         d}t                              |           	 t          t                                                                | _         n2# t          $ r% d| _         t                              d           Y dS w xY w|| j         v p&|
                                                    d          S )	NFT
NO_NETWORK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 ::)rR   rU   osgetenv_loggerdebugsetrO   
splitlines	Exceptionlower
startswith)rX   r   msgs      r
   __call__z_TroveClassifier.__call__   s&   ?e##t':d'B'B49\"" 	bi0O&P&P 	#DOP  MM#4?"P  MM#"%&;&=&=&H&H&J&J"K"K   "'JKKKtt
 'Q5;;==+C+CL+Q+QQs   2B9 9+C('C()r   N)rV   
__module____qualname____doc__typingUnionSetstr__annotations__rY   r[   boolrj   r   r   r
   rQ   rQ      s           T#3VZ_DEEEE+ + + +# # # #Rc Rd R R R R R Rr   rQ   )classifiersc                 b    | t           v p&|                                                     d          S )z!See https://pypi.org/classifiers/r_   )_trove_classifiersrg   rh   r   s    r
   rT   rT      s)    **Tekkmm.F.F|.T.TTr   c           	          |                      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`.
    r1   -stubsFN)r7   endswithpython_module_namejoinlen)r   topchildrens      r
   pep561_stub_namer      sg    
 [[%%NC(<<!! uchh,<s8}}n,<(='I'IJJKKKr   c                 >   ddl m} 	  ||           }|j        sYt                              d|             |                     d          s'|                     d          sd| v s |d|            }t          |j        o|j                  S # t          $ r Y dS w xY 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.parser   schemerb   warningrh   rs   netlocrf   )r   r   partss      r
   rL   rL      s    
 &%%%%%| 	4OO( %( (  
 $$S)) 4U-=-=d-C-C 4se|| !25!2!233EL1U\222   uus   BB 
BBz[^\[\s=]([^=]*[^\s=])?z[\w.-]+z\w+(\.\w+)*c                 *    |                                  S )zXCan be used as identifier in Python.
    (Validation uses :obj:`str.isidentifier`).
    )isidentifierr   s    r
   r4   r4     s     r   c                     |                      d          s|                     d          rdS t          d |                     d          D                       S )z
    Python "dotted identifier", i.e. a sequence of :obj:`python_identifier`
    concatenated with ``"."`` (e.g.: ``package.module.submodule``).
    r1   Fc              3   4   K   | ]}t          |          V  d S r    r3   )r!   ms     r
   r#   z.python_qualified_identifier.<locals>.<genexpr>  s+      >> ##>>>>>>r   )rh   ry   r8   r7   r   s    r
   python_qualified_identifierr     s[    
  s 3 3 u>>U[[-=-=>>>>>>r   c                      t          |           S )zsModule name that can be used in an ``import``-statement in Python.
    See :obj:`python_qualified_identifier`.
    )r   r   s    r
   rz   rz     s     'u---r   c                     |                      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`).
    -Frx   r:   )rh   ry   rz   replacer   s    r
   python_module_name_relaxedr   &  sg      s 3 3 u~~h uemmC55666r   c                 :    t                               |           duS )zhSee ``Data model > group`` in the :ref:`PyPA's entry-points specification
    <pypa:entry-points>`.
    N)ENTRYPOINT_GROUP_REGEXr	   r   s    r
   python_entrypoint_groupr   9  s     "''..d::r   c                     t                               |           sdS t                              |           s*d|  d}|t          z  }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_PATTERNrb   r   )r   ri   s     r
   python_entrypoint_namer   @  sg     !!%(( u&,,U33 LeLLL,,4r   c                 N   |                      d          \  }}}d|v r|                     d          \  }}}|                                d         dk    rdS d |                    t          j        dz                                 d          D             }t          d	 |D                       sdS t                              d
|  d           n|}|                    d          }|r#t          ||                    d                    n|}t          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              3   >   K   | ]}|                                 V  d S r    r-   )r!   xs     r
   r#   z.python_entrypoint_reference.<locals>.<genexpr>Z  s*      XX!''))XXXXXXr   z[],c              3   4   K   | ]}t          |          V  d S r    )r   )r!   es     r
   r#   z.python_entrypoint_reference.<locals>.<genexpr>[  s+      88A$Q''888888r   `z4` - using extras for entry points is not recommendedr1   c              3   X   K   | ]%}t          |                                          V  &d S r    )r4   r.   r/   s     r
   r#   z.python_entrypoint_reference.<locals>.<genexpr>c  s3      AA ++AAAAAAr   )	r5   r.   string
whitespacer7   r8   rb   r   r6   )	r   r9   r:   restr;   extras_extrasmodule_partsr<   s	            r
   python_entrypoint_referencer   M  s)    ooc**OFAt
d{{..--Q==??2#%%5XXW]]63Dt3K%L%L%R%RSV%W%WXXX8888888 	5WEWWWXXXX<<$$L:>P&syy~~666LKAA[AAAAAAr   c                 "    d| cxk    odk     nc S )z/Unsigned 8-bit integer (:math:`0 \leq x < 2^8`)r      r   r   s    r
   uint8r   f  s$    r   c                 "    d| cxk    odk     nc S )z3Unsigned 16-bit integer (:math:`0 \leq x < 2^{16}`)r   i   r   r   s    r
   uint16r   k  $    r   c                 "    d| cxk    odk     nc S )z3Unsigned 64-bit integer (:math:`0 \leq x < 2^{64}`)r   l            r   r   s    r
   uintr   p  r   r   c                 "    d| cxk    odk     nc S )z7Signed 64-bit integer (:math:`-2^{63} \leq x < 2^{63}`)l         l            r   r   s    r
   intr   u  s$    u$$$$u$$$$$r   )=rm   builtinsloggingr`   rer   rn   	itertoolsr   r6   TYPE_CHECKINGtyping_extensionsr   	getLoggerrV   rb   VERSION_PATTERNcompileXIr   rq   rs   r   PEP508_IDENTIFIER_PATTERNr   r   	packagingr   r   ImportErrorsetuptools._vendor.packagingr   r   r)   r=   rO   rQ   trove_classifiersrt   rv   rT   r   rL   ENTRYPOINT_PATTERNr   r   r   ENTRYPOINT_GROUP_PATTERNr   r4   r   rz   r   r   r   r   r   r   r   r   r   r   r
   <module>r      st      				 				   % % % % % %	 *))))))
'
H
%
%
> 
7_4w>rtLL4C 4D 4 4 4 4 G $"*%E)B%E%E%ErtLL ;C ;D ; ; ; ;
2222222 
 
 
	
 	
 	
 	
 	
 	
 	
 	

c d         OO	=  c d      )c )d ) ) ) )&?C ?D ? ? ? ?
Ms 
M 
M 
M 
M/R /R /R /R /R /R /R /Rd*CCCCCCU U U U U U U  * * *''))*LC LD L L L Ls t    0 / 2:7"4777>>  * (bj)M-J)M)M)MrtTT ) #$C(@$C$C$CRTJJ  S  T        ?s ?t ? ? ? ?.c .d . . . .7c 7d 7 7 7 7&;3 ;4 ; ; ; ;
# 
$ 
 
 
 
Bs Bt B B B B2 $    
(, 4    
     
%x| % % % % % % %sB   B B3 B'$B3 &B''B3 3"CC?D D D 