
    PhX                    f   U 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Zd dl	m
Z
 d dlmZmZmZmZmZ ddlmZmZ  ej(                  e      Zee   Zeeef   Zddd	d
ddZded<    ej8                  d      dk(  Z G d d      Zd,dZd-d.dZ d/dZ!d0dZ"d1dZ#d-d2dZ$	 	 	 d3dd	 	 	 	 	 	 	 	 	 d4dZ%d5dZ&	 	 	 d3dd	 	 	 	 	 	 	 	 	 d6dZ'd7dZ(	 	 	 d3	 	 	 	 	 	 	 d8dZ)efd9d Z*d:d!Z+	 d;	 	 	 	 	 d<d"Z,	 d;	 	 	 	 	 d=d#Z-	 d;	 	 	 	 	 d>d$Z.efd?d%Z/d@d&Z0d@d'Z1dAd(Z2dddBd)Z3dCd*Z4dddDd+Z5y)E    )annotationsN)EXTENSION_SUFFIXES)IterableIteratorSequenceTuplecast   )
_manylinux
_musllinuxpycpppipjy)pythoncpythonpypy
ironpythonjythonzdict[str, str]INTERPRETER_SHORT_NAMESP   c                  v    e Zd ZdZg dZddZedd       Zedd       Zedd       Z	ddZ
ddZdd	Zdd
Zy)Tagz
    A representation of the tag triple for a wheel.

    Instances are considered immutable and thus are hashable. Equality checking
    is also supported.
    )_abi_hash_interpreter	_platformc                    |j                         | _        |j                         | _         |j                          | _        t	        | j                  | j                  | j                  f      | _        y N)lowerr   r   r   hashr   )selfinterpreterabiplatforms       `/mnt/c/Users/Administrator/Desktop/help_/test_env/lib/python3.12/site-packages/packaging/tags.py__init__zTag.__init__4   sS    '--/IIK	') 4,,diiHI
    c                    | j                   S r!   )r   r$   s    r(   r%   zTag.interpreter?   s       r*   c                    | j                   S r!   )r   r,   s    r(   r&   zTag.abiC   s    yyr*   c                    | j                   S r!   )r   r,   s    r(   r'   zTag.platformG   s    ~~r*   c                   t        |t              st        S | j                  |j                  k(  xrO | j                  |j                  k(  xr4 | j
                  |j
                  k(  xr | j                  |j                  k(  S r!   )
isinstancer   NotImplementedr   r   r   r   )r$   others     r(   __eq__z
Tag.__eq__K   sn    %%!! ZZ5;;& :5??2:ejj(: ""e&8&88		
r*   c                    | j                   S r!   )r   r,   s    r(   __hash__zTag.__hash__V   s    zzr*   c                R    | j                    d| j                   d| j                   S )N-)r   r   r   r,   s    r(   __str__zTag.__str__Y   s)    ##$Adii[$..1ABBr*   c                &    d|  dt        |        dS )N<z @ >)idr,   s    r(   __repr__zTag.__repr__\   s    4&BtH:Q''r*   N)r%   strr&   r>   r'   r>   returnNoner?   r>   )r2   objectr?   bool)r?   int)__name__
__module____qualname____doc__	__slots__r)   propertyr%   r&   r'   r3   r5   r8   r=    r*   r(   r   r   *   se     ?I	J ! !    	
C(r*   r   c           
        t               }| j                  d      \  }}}|j                  d      D ]J  }|j                  d      D ]4  }|j                  d      D ]  }|j                  t        |||               6 L t	        |      S )z
    Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.

    Returning a set is required due to the possibility that the tag is a
    compressed tag set.
    r7   .)setsplitaddr   	frozenset)tagtagsinterpretersabis	platformsr%   r&   	platform_s           r(   	parse_tagrX   `   s     5D$'IIcN!L$	#))#. ;::c? 	;C&__S1 ;	[#y9:;	;; T?r*   Fc                d    t        j                  |       }||rt        j                  d|        |S )Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)	sysconfigget_config_varloggerdebug)namewarnvalues      r(   _get_config_varra   p   s1    '66t<E}Ld	
 Lr*   c                f    | j                  dd      j                  dd      j                  dd      S )NrM   _r7    )replace)strings    r(   _normalize_stringrg   y   s-    >>#s#++C5==c3GGr*   c                    t        |       dk(  ryt        j                  d| d         }|sy|j                  d      }d|v S )z
    Determine if the ABI corresponds to a threaded (`--disable-gil`) build.

    The threaded builds are indicated by a "t" in the abiflags.
    r   Fz	cp\d+(.*)r
   t)lenrematchgroup)rU   mabiflagss      r(   _is_threaded_cpythonrp   }   sC     4yA~
tAw'AwwqzH(?r*   c                H    t        |       dkD  xr t        |       dk\  xr | S )z
    Determine if the Python version supports abi3.

    PEP 384 was first implemented in Python 3.2. The threaded (`--disable-gil`)
    builds do not support abi3.
    r
   )      )rj   tuple)python_version	threadings     r(   _abi3_appliesrw      s*     ~"Xu^'<'FXy=Xr*   c           	        t        |       } g }t        | d d       }dx}x}x}}t        d|      }t        t        d      }	dt
        v }
|s||	s|
rd}| dk\  rt        d|      rd	}| d
k  r@t        d|      }|s|d}| dk  rAt        d|      }|dk(  s|.t        j                  dk(  rd}n|r|j                  d| |        |j                  dd| | | | |        |S )Nrs    Py_DEBUGgettotalrefcountz_d.pydd)rr      Py_GIL_DISABLEDri   )rr      WITH_PYMALLOCrn   )rr   rr   Py_UNICODE_SIZEr   i ur   r   )	rt   _version_nodotra   hasattrsysr   
maxunicodeappendinsert)
py_versionr_   rU   versionrv   r]   pymallocucs4
with_debughas_refcounthas_extwith_pymallocunicode_sizes                r(   _cpython_abisr      s   z"JDZ^,G*,,I,,4 T2J3 23L ,,Gj(lgW1BD!I	F'>M1H*+<dCLq $8)C	 	b	)-.KKRyE78*TFCDKr*   r_   c             #  x  K   | st         j                  dd } dt        | dd        |t        |       dkD  rt	        | |      }ng }t        |      }dD ]  }	 |j                  |        t        |xs
 t                     }|D ]  }|D ]  }t        ||         t        |      }t        | |      }|rfd|D        E d{    fd|D        E d{    |rDt        | d   dz
  dd      D ]-  }	|D ]&  }t        | d	   |	f      }
d|
 t        d
|       ( / yy# t        $ r Y w xY w7 m7 \w)a  
    Yields the tags for a CPython interpreter.

    The tags consist of:
    - cp<python_version>-<abi>-<platform>
    - cp<python_version>-abi3-<platform>
    - cp<python_version>-none-<platform>
    - cp<less than python_version>-abi3-<platform>  # Older Python versions down to 3.2.

    If python_version only specifies a major version then user-provided ABIs and
    the 'none' ABItag will be used.

    If 'abi3' or 'none' are specified in 'abis' then they will be yielded at
    their normal position and not at the beginning.
    Nrs   r   r
   )abi3nonec              3  8   K   | ]  }t        d |        yw)r   Nr   .0rW   r%   s     r(   	<genexpr>zcpython_tags.<locals>.<genexpr>   s     SICVY7S   c              3  8   K   | ]  }t        d |        yw)r   Nr   r   s     r(   r   zcpython_tags.<locals>.<genexpr>   s     O	K3Or   r   r   )r   version_infor   rj   r   listremove
ValueErrorplatform_tagsr   rp   rw   range)ru   rU   rV   r_   explicit_abir&   rW   rv   use_abi3minor_versionr   r%   s              @r(   cpython_tagsr      s    , ))"1-~nRa&89:;K|~" 6DD:D( 	KK% Y1-/2I 3" 	3Ik3	22	33 %T*I^Y7HSSSSOYOOO">!#4q#8!R@ 	:M& :	(.*;])KL "7)n+vy99:	:   		 	TOsJ   AD:D'+AD:D6	D:D8AD:'	D30D:2D33D:8D:c                 z   t        dd      } t        | t              r| d   dk7  rt        d      | j	                  d      }t        |      dk  rt        t        j                  dd	       S |d
   }|j                  d      rd|j	                  d      d
   z   }n|j                  d      r|j	                  d      d   }nq|j                  d      r$dj                  |j	                  d      dd	       }n<|j                  d      r$dj                  |j	                  d      dd       }n|r|}ng S t        |      gS )z1
    Return the ABI tag based on EXT_SUFFIX.
    
EXT_SUFFIXTr   r   rM   z.invalid sysconfig.get_config_var('EXT_SUFFIX')rr   Nrs   r
   r   r   r7   r   graalpy)ra   r0   r>   SystemErrorrO   rj   r   r   r   
startswithjoinrg   )
ext_suffixpartssoabir&   s       r(   _generic_abir      s'    !D9Jj#&*Q-3*>JKKS!E
5zA~S--bq122!HE	"U[[%a((			$	kk#q!			&	!hhu{{3'+,			)	$hhu{{3'+,		c"##r*   c             #  $  K   | s)t               }t        |      }dj                  ||g      } |t               }nt	        |      }t	        |xs
 t                     }d|vr|j                  d       |D ]  }|D ]  }t        | ||         yw)z
    Yields the tags for a generic interpreter.

    The tags consist of:
    - <interpreter>-<abi>-<platform>

    The "none" ABI will be added if it was not explicitly provided.
    r   ry   Nr   )interpreter_nameinterpreter_versionr   r   r   r   r   r   )r%   rU   rV   r_   interp_nameinterp_versionr&   rW   s           r(   generic_tagsr     s      &(,$7gg{N;<|~DzY1-/2ITF 3" 	3Ik3	22	33s   BBc              #     K   t        |       dkD  rdt        | dd         d| d     t        |       dkD  r.t        | d   dz
  dd      D ]  }dt        | d   |f         yyw)z
    Yields Python versions in descending order.

    After the latest version, the major-only version will be yielded, and then
    all previous versions of that major version.
    r
   r   Nrs   r   r   )rj   r   r   )r   minors     r(   _py_interpreter_ranger   ;  s      :>*Ra.1233z!}o

::a=1,b"5 	@E~z!}e&<=>??	@ s   A)A+c              #    K   | st         j                  dd } t        |xs
 t                     }t	        |       D ]  }|D ]  }t        |d|         |rt        |dd       t	        |       D ]  }t        |dd        yw)z
    Yields the sequence of tags that are compatible with a specific version of Python.

    The tags consist of:
    - py*-none-<platform>
    - <interpreter>-none-any  # ... if `interpreter` is provided.
    - py*-none-any
    Nrs   r   any)r   r   r   r   r   r   )ru   r%   rV   r   rW   s        r(   compatible_tagsr   J  s      ))"1-Y1-/2I(8 2" 	2Igvy11	22 +vu--(8 *'65))*s   BBc                0    |s| S | j                  d      ryy)Nppci386)r   )archis_32bits     r(   	_mac_archr   c  s    ur*   c                d   |g}|dk(  r| dk  rg S |j                  g d       nb|dk(  r| dk  rg S |j                  g d       nB|dk(  r| dkD  s| dk  rg S |j                  d       n|d	k(  r| d
kD  rg S |j                  ddg       |dv r|j                  d       |dv r|j                  d       |S )Nx86_64)
   r   )intelfat64fat32r   )r   r   fatppc64)r      r   r   )r      r   r   >   arm64r   
universal2>   r   r   r   r   r   	universal)extendr   )r   cpu_archformatss      r(   _mac_binary_formatsr   m  s    jG8WI23	V	WI01	W	W' 1Iw	U	WI'(&&|$>>{#Nr*   c              #    K   t        j                         \  }}}| t        dt        t	        t
        |j                  d      dd                   } | dk(  r~t        j                  t        j                  dddgd	d
dit        j                  d	      j                  }t        dt        t	        t
        |j                  d      dd                   } n| } |t        |      }n|}d| k  r@| dk  r;d}t        | d   dd      D ]&  }||f}t        ||      }|D ]  }	d| d| d|	   ( | dk\  r;d}t        | d   dd      D ]&  }||f}t        ||      }|D ]  }	d| d| d|	   ( | dk\  rdd}|dk(  r7t        ddd      D ]&  }||f}t        ||      }|D ]  }	d| d| d|	   ( yt        ddd      D ]  }||f}d}	d| d| d|	   yyw)aD  
    Yields the platform tags for a macOS system.

    The `version` parameter is a two-item tuple specifying the macOS version to
    generate platform tags for. The `arch` parameter is the CPU architecture to
    generate platform tags for. Both parameters default to the appropriate value
    for the current system.
    NAppleVersionrM   rs   )r      z-sSz-cz-import platform; print(platform.mac_ver()[0])TSYSTEM_VERSION_COMPAT0)checkenvstdouttext)r   r   )   r   r   r
   r   macosx_rc   r   r   r   rr   r   )r'   mac_verr	   rt   maprD   rO   
subprocessrunr   
executablePIPEr   r   r   r   )
r   r   version_strrc   r   major_versionr   compat_versionbinary_formatsbinary_formats
             r(   mac_platformsr     s      (//1KH~uSk6G6G6LRa6P-Q'RSh %..NNC	 ,c2! f  >5S+:K:KC:PQSRS:T1U+VWG|"'g/ "71:r26 	PM*M9N0FN!/ PaaOOP	P ' "71:r26 	PM*M9N0FN!/ PaaOOP	P ' 8!&r1b!1 T!.!=!4^T!J%3 TM#M?!M?!M?SSTT "'r1b!1 P!.!= ,aaOOP! s   GGc              #  8  K   | Nt        j                         \  }}}}t        dt        t	        t
        |j                  d      dd                   } |t        j                  j                  }|j                  dd      }d}| d   d	k  ry|j                  | d   | d
   |       t        | d
   d
z
  dd      D ]  }|j                  | d   ||        t        | d   d
z
  dd      D ]*  }t        ddd      D ]  }|j                  |||        , yw)a  
    Yields the platform tags for an iOS system.

    :param version: A two-item tuple specifying the iOS version to generate
        platform tags for. Defaults to the current iOS version.
    :param multiarch: The CPU architecture+ABI to generate platform tags for -
        (the value used by `sys.implementation._multiarch` e.g.,
        `arm64_iphoneos` or `x84_64_iphonesimulator`). Defaults to the current
        multiarch value.
    Nr   rM   rs   r7   rc   zios_{major}_{minor}_{multiarch}r      r
   )majorr   	multiarchr   r   	   )r'   ios_verr	   rt   r   rD   rO   r   implementation
_multiarchre   formatr   )r   r   rc   releaseios_platform_templater   r   s          r(   ios_platformsr     sT      $++-7Aq~uSgmmC6H!6L-M'NO&&11	!!#s+I= qzB  
&
&aj
i '   wqzA~r2. 
#**!*EY + 
 	


 wqzA~r2. 1b"% 	E'..5I /  	s   DDc              #  @  K   t        j                         dk7  r| |t        d      | t        j                         j                  } |&t        j                         j                  d      d   }t        |      }d}t        | |dz
  d      D ]  }d| d	|   yw)
a  
    Yields the :attr:`~Tag.platform` tags for Android. If this function is invoked on
    non-Android platforms, the ``api_level`` and ``abi`` arguments are required.

    :param int api_level: The maximum `API level
        <https://developer.android.com/tools/releases/platforms>`__ to return. Defaults
        to the current system's version, as returned by ``platform.android_ver``.
    :param str abi: The `Android ABI <https://developer.android.com/ndk/guides/abis>`__,
        e.g. ``arm64_v8a``. Defaults to the current system's ABI , as returned by
        ``sysconfig.get_platform``. Hyphens and periods will be replaced with
        underscores.
    AndroidNzFon non-Android platforms, the api_level and abi arguments are requiredr7   r   r   r
   android_rc   )
r'   system	TypeErrorandroid_ver	api_levelrZ   get_platformrO   rg   r   )r   r&   min_api_levelvers       r(   android_platformsr    s      I%9+<T
 	
  ((*44	
{$$&,,S1"5
C
 C
 MY 126 %Qse$$%s   BBc              #    K   t        t        j                               }|j                  d      s| y | r|dk(  rd}n|dk(  rd}|j	                  dd      \  }}ddd	gij                  ||g      }t        j                  |      E d {    t        j                  |      E d {    |D ]	  }d|   y 7 07 w)
Nlinux_linux_x86_64
linux_i686linux_aarch64linux_armv8lrc   r
   armv8larmv7l)	rg   rZ   r   r   rO   getr   r   r   )r   linuxrc   r   archss        r(   _linux_platformsr  :  s     i4467EH%N" Eo%"Ekk#q!GAt(+,00v>E''...''... tfo /.s$   B	C B<C (B>)C >C c               #  J   K   t        t        j                                y wr!   )rg   rZ   r   rK   r*   r(   _generic_platformsr  M  s     
I224
55s   !#c                    t        j                         dk(  r
t               S t        j                         dk(  r
t               S t        j                         dk(  r
t	               S t        j                         dk(  r
t               S t               S )z;
    Provides the platform tags for this installation.
    DarwiniOSr   Linux)r'   r   r   r   r  r  r  rK   r*   r(   r   r   Q  sk     H$		e	#		i	' ""		g	%!!!##r*   c                 h    t         j                  j                  } t        j	                  |       xs | S )z
    Returns the name of the running interpreter.

    Some implementations have a reserved, two-letter abbreviation which will
    be returned when appropriate.
    )r   r   r^   r   r  )r^   s    r(   r   r   a  s+     ""D"&&t,44r*   c                v    t        d|       }|rt        |      }|S t        t        j                  dd       }|S )z9
    Returns the version of the running interpreter.
    py_version_nodotr   Nrs   )ra   r>   r   r   r   )r_   r   s     r(   r   r   l  sB     0t<Gg, N !!1!1"1!56Nr*   c                @    dj                  t        t        |             S )Nry   )r   r   r>   )r   s    r(   r   r   x  s    773sG$%%r*   c              #     K   t               }|dk(  rt        |       E d{    nt               E d{    |dk(  rd}n|dk(  rdt        |       z   }nd}t	        |      E d{    y7 K7 :7 	w)z
    Returns the sequence of tag triples for the running interpreter.

    The order of the sequence corresponds to priority order for the
    interpreter, from most to least important.
    r   r   Nr   pp3)r%   )r   r   r   r   r   )r_   r   interps      r(   sys_tagsr  |  sx      #$KdT***>!!d		+666222 	+! 3s1   A3A-A3A/2A3'A1(A3/A31A3)rR   r>   r?   zfrozenset[Tag])F)r^   r>   r_   rC   r?   zint | str | None)rf   r>   r?   r>   )rU   	list[str]r?   rC   )ru   PythonVersionrv   rC   r?   rC   )r   r  r_   rC   r?   r  )NNN)
ru   PythonVersion | NonerU   Iterable[str] | NonerV   r!  r_   rC   r?   Iterator[Tag])r?   r  )
r%   
str | NonerU   r!  rV   r!  r_   rC   r?   r"  )r   r  r?   Iterator[str])ru   r   r%   r#  rV   r!  r?   r"  )r   r>   r   rC   r?   r>   )r   r   r   r>   r?   r  )NN)r   AppleVersion | Noner   r#  r?   r$  )r   r%  r   r#  r?   r$  )r   z
int | Noner&   r#  r?   r$  )r   rC   r?   r$  )r?   r$  rA   )r_   rC   r?   r>   )r   r  r?   r>   )r_   rC   r?   r"  )6
__future__r   loggingr'   rk   structr   r   rZ   importlib.machineryr   typingr   r   r   r   r	   ry   r   r   	getLoggerrE   r\   rD   r  r   r   __annotations__calcsize_32_BIT_INTERPRETERr   rX   ra   rg   rp   rw   r   r   r   r   r   r   r   r   r   r   r  r  r  r   r   r   r   r  rK   r*   r(   <module>r/     sD  
 #   	   
  2  %			8	$S#X +   &fooc*a/ 3( 3(l H YD ,0!%&*8:
 8:(8:
8: $8:
 8: 8:v&$T #!%&*3
 33
3 $3
 3 3>@  ,0"&**(** $* 	*2 +> B =ALP LP/9LPLP` BF6 64>66t 59"%"%'1"%"%J ': &6$ 5 ). 	& # 3r*   