HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/.local/lib/python3.10/site-packages/packaging/__pycache__/_manylinux.cpython-310.pyc
o

���g�%�@s2UddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZm
Z
ddlmZmZmZmZdZdZdZejd7d
d��Zd8dd�Zd8dd�Zd9dd�Ze�dd��Zded<Gdd�de�Zd:d d!�Zd:d"d#�Z d:d$d%�Z!d;d(d)�Z"ej#d<d*d+��Z$d=d.d/�Z%d0d1d2d3�Z&d>d5d6�Z'dS)?�)�annotationsN)�	Generator�Iterator�
NamedTuple�Sequence�)�EIClass�EIData�ELFFile�EMachinel~ii�path�str�return�%Generator[ELFFile | None, None, None]c
csb�zt|d��}t|�VWd�WdS1swYWdStttfy0dVYdSw)N�rb)�openr
�OSError�	TypeError�
ValueError)r�f�r�G/home/arjun/.local/lib/python3.10/site-packages/packaging/_manylinux.py�
_parse_elfs�&��r�
executable�boolcCsvt|��-}|duo(|jtjko(|jtjko(|jtj	ko(|j
t@tko(|j
t
@t
k	Wd�S1s4wYdS�N)r�capacityr�C32�encodingr	�Lsb�machiner�Arm�flags�EF_ARM_ABIMASK�EF_ARM_ABI_VER5�EF_ARM_ABI_FLOAT_HARD�rrrrr�_is_linux_armhfs

�
�
���$�r'cCsZt|��}|duo|jtjko|jtjko|jtj	k	Wd�S1s&wYdSr)
rrrrrr	rr r�I386r&rrr�_is_linux_i686-s

�
�
�$�r)�archs�
Sequence[str]cs>d|vrt|�Sd|vrt|�Shd��t�fdd�|D��S)N�armv7l�i686>�ppc64�s390x�x86_64�aarch64�ppc64le�riscv64�loongarch64c3s�|]}|�vVqdSrr)�.0�arch��
allowed_archsrr�	<genexpr>Es�z'_have_compatible_abi.<locals>.<genexpr>)r'r)�any)rr*rr7r�_have_compatible_abi7s	r;cCsdS)N�2rrrrr�<lambda>Msr=zdict[int, int]�_LAST_GLIBC_MINORc@seZdZUded<ded<dS)�
_GLibCVersion�int�major�minorN)�__name__�
__module__�__qualname__�__annotations__rrrrr?Ps
r?�
str | NonecCsFzt�d�}|dusJ�|��\}}W|Sttttfy"YdSw)zJ
    Primary implementation of glibc_version_string using os.confstr.
    �CS_GNU_LIBC_VERSIONN)�os�confstr�rsplit�AssertionError�AttributeErrorrr)�version_string�_�versionrrr�_glibc_version_string_confstrUs
��rQcCs�zddl}Wn
tyYdSwz|�d�}Wn
ty"YdSwz|j}Wn
ty2YdSw|j|_|�}t|t	�sD|�
d�}|S)zG
    Fallback implementation of glibc_version_string using ctypes.
    rN�ascii)�ctypes�ImportError�CDLLr�gnu_get_libc_versionrM�c_char_p�restype�
isinstancer
�decode)rS�process_namespacerV�version_strrrr�_glibc_version_string_ctypeshs(��
�

r]cCst�pt�S)z9Returns glibc version string, or None if not using glibc.)rQr]rrrr�_glibc_version_string�sr^r\�tuple[int, int]cCsFt�d|�}|stjd|��tdd�dSt|�d��t|�d��fS)a3Parse glibc version.

    We use a regexp instead of str.split because we want to discard any
    random junk that might come after the minor version -- this might happen
    in patched/forked versions of glibc (e.g. Linaro's version of glibc
    uses version strings like "2.20-2014.11"). See gh-3588.
    z$(?P<major>[0-9]+)\.(?P<minor>[0-9]+)z;Expected glibc version with 2 components major.minor, got: �)�
stacklevel����rcrArB)�re�match�warnings�warn�RuntimeWarningr@�group)r\�mrrr�_parse_glibc_version�s��rkcCst�}|dur	dSt|�S)Nrb)r^rk)r\rrr�_get_glibc_version�srlr6rPcCs�t�}||kr	dSzddl}Wn
tyYdSwt|d�r4|�|d|d|�}|dur2t|�SdS|tdd�krEt|d�rEt|j�S|tdd	�krVt|d
�rVt|j�S|tdd�krgt|d�rgt|j	�SdS)
NFrT�manylinux_compatiblerr`��manylinux1_compatible��manylinux2010_compatible��manylinux2014_compatible)
rl�
_manylinuxrT�hasattrrmrr?rorqrs)r6rP�	sys_glibcrt�resultrrr�_is_compatible�s.�






rx�
manylinux2014�
manylinux2010�
manylinux1))r`rr)r`rp)r`rn�
Iterator[str]ccs�ttj|�s	dStdd�}t|�ddh@rtdd�}tt��}|g}t|jddd�D]}t|}|�	t||��q,|D]J}|D]E}|j|jkrM|j
}nd}t|j
|d�D]/}t|j|�}	d	j|	�}
t||	�rp|
�d
|��V|	t
vr�t
|	}t||	�r�|�d
|��VqVqAq=dS)a�Generate manylinux tags compatible to the current platform.

    :param archs: Sequence of compatible architectures.
        The first one shall be the closest to the actual architecture and be the part of
        platform tag after the ``linux_`` prefix, e.g. ``x86_64``.
        The ``linux_`` prefix is assumed as a prerequisite for the current platform to
        be manylinux-compatible.

    :returns: An iterator of compatible manylinux tags.
    Nr`�r0r-�rrczmanylinux_{}_{}rO)r;�sysrr?�setrl�rangerAr>�appendrB�formatrx�_LEGACY_MANYLINUX_MAP)r*�too_old_glibc2�
current_glibc�glibc_max_list�glibc_major�glibc_minorr6�	glibc_max�	min_minor�
glibc_version�tag�
legacy_tagrrr�
platform_tags�s:�





����r�)rr
rr)rr
rr)rr
r*r+rr)rrG)r\r
rr_)rr_)r6r
rPr?rr)r*r+rr|)(�
__future__r�collections�
contextlib�	functoolsrIrdrrf�typingrrrr�_elffilerr	r
rr#r$r%�contextmanagerrr'r)r;�defaultdictr>rFr?rQr]r^rk�	lru_cacherlrxr�r�rrrr�<module>s@






,

�