HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/relenv/__pycache__/common.cpython-310.pyc
o

;j=��@s�dZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlmZmZmZmZmZmZer`ddlmZmZmZdZe�e �Z!e�"e#��$�j%Z&dZ'dZ(d	Z)d
Z*dZ+dZ,d�dd�Z-d�dd�Z.d�dd�Z/d�dd�Z0d�d d!�Z1d�d#d$�Z2d�d%d&�Z3d'd(e��iZ4d)Z5e'd*e)d+e(d,iZ6ej	dkr�ej"�7�d-d.d/Z8n	ej"�7�d0d/Z8e�"ej9�:d1e8���$�Z;e�<d2�Z=e�<d3�Z>ej	dkr�e=Z?ne>Z?Gd4d5�d5e@�ZAGd6d7�d7eA�ZBGd8d9�d9eB�ZCGd:d;�d;eB�ZDGd<d=�d=eA�ZEGd>d?�d?eA�ZFGd@dA�dAeA�ZGGdBdC�dCeA�ZHGdDdE�dEeA�ZIGdFdG�dGeA�ZJe?fd�dKdL�ZKd�dMdN�ZL	d�d�dQdR�ZMd�d�dTdU�ZNGdVdW�dW�ZO	d�d�dXdY�ZP		d�d�d\d]�ZQd�d�d`da�ZRd�dbdc�ZSd�dedf�ZTd�d�dhdi�ZUd�dmdn�ZVd�dqdr�ZWd�d�dxdy�ZX	z	{	d�d�d�d��ZYd�d�d�d��ZZ	�	z	{	d�d�d�d��Z[d�d�d��Z\d�d�d��Z]d�d�d��Z^d�d�d��Z_d�d�d��Z`Gd�d��d��ZadS)�z/
Common classes and values used around relenv.
�)�annotationsN)�IO�
TYPE_CHECKING�Any�BinaryIO�Literal�cast)�Callable�Iterable�Mappingz0.22.14�linux�win32�darwinz10.15ZRELENV_TOOLCHAIN_CACHEz.toolchain-manifest.json�path�pathlib.Path�return�dict[str, str | int]cCs |��}t|���|j|jd�S)N)�archive�size�mtime)�stat�str�resolve�st_size�st_mtime_ns)rr�r�A/opt/saltstack/salt/lib/python3.10/site-packages/relenv/common.py�_archive_metadata/s

�r�pathlib.Path | NonecCsvtj�t�}|r|����dkrdSt�|���Sdtjvr dStj�d�}|r.t�|�}ntj�	�d}|ddS)NZnone�RELENV_DATAZXDG_CACHE_HOMEz.cache�relenvZ
toolchains)
�os�environ�get�TOOLCHAIN_CACHE_ENV�strip�lower�pathlib�Path�
expanduser�home)�overrideZ
cache_home�baserrr�_toolchain_cache_root8s
r-�toolchain_pathcCs|tS�N)�_TOOLCHAIN_MANIFEST)r.rrr�_toolchain_manifest_pathIsr1�Mapping[str, Any] | Nonec	Cst|��sdSz|jdd��
}t�|�}Wd�n1swYWn
ttjfy0YdSwt|t�s8dS|S)N�utf-8��encoding)�exists�open�json�load�OSError�JSONDecodeError�
isinstance�dict)r�handle�datarrr�_load_toolchain_manifestMs���
r@�manifest�Mapping[str, Any]�metadata�boolcCs<|�d�|�d�ko|�d�|�d�ko|�d�|�d�kS)Nrrr)r#)rArCrrr�_manifest_matchesZs
��rE�Nonec
Cs�t|�}z*|jddd��}tj||ddd�|�d�Wd�WdS1s'wYWdStyH}zt�d||�WYd}~dSd}~ww)	N�wr3r4�T)�indent�	sort_keys�
z.Unable to persist toolchain manifest at %s: %s)r1r7r8�dump�writer:�log�warning)r.rCZ
manifest_pathr>�excrrr�_write_toolchain_manifestbs&���rQcCs(tjdkrtSt�}|durtdS|S)z5Return the root directory used for cached toolchains.rN�	toolchain)�sys�platform�DATA_DIRr-��rootrrr�toolchain_root_dirls
rXz
User-Agentzrelenv )z5packages.broadcom.com/artifactory/saltproject-genericzwoz.io)�x86_64Zaarch64)rYZarm64)Zamd64Zx86ZAppDataZLocalr z.localrzn#!/bin/sh
"true" ''''
# shellcheck disable=SC2093
"exec" "$(dirname "$(readlink -f "$0")"){}" "$0" "$@"
' '''
a�#!/bin/sh
"true" ''''
TARGET_FILE=$0
cd "$(dirname "$TARGET_FILE")" || return
TARGET_FILE=$(basename "$TARGET_FILE")
# Iterate down a (possible) chain of symlinks
while [ -L "$TARGET_FILE" ]
do
    TARGET_FILE=$(readlink "$TARGET_FILE")
    cd "$(dirname "$TARGET_FILE")" || return
    TARGET_FILE=$(basename "$TARGET_FILE")
done
PHYS_DIR=$(pwd -P)
REALPATH=$PHYS_DIR/$TARGET_FILE
# shellcheck disable=SC2093
"exec" "$(dirname "$REALPATH")"{} "$REALPATH" "$@"
' '''
c@�eZdZdZdS)�RelenvExceptionz9
    Base class for exeptions generated from relenv.
    N��__name__�
__module__�__qualname__�__doc__rrrrr[��r[c@rZ)�ValidationErrorz�Base class for validation-related errors.

    Raised when data validation fails (checksums, signatures, etc.).
    This follows CPython's convention of having intermediate base classes
    for related exception types.
    Nr\rrrrrb�rarbc@rZ)�ChecksumValidationErroragRaised when file checksum verification fails.

    This typically indicates file corruption or tampering. The error message
    should include the expected and actual checksums when available.

    Example:
        raise ChecksumValidationError(
            f"Checksum mismatch for {filename}: "
            f"expected {expected}, got {actual}"
        )
    Nr\rrrrrc�rarcc@rZ)�SignatureValidationErroraVRaised when GPG signature verification fails.

    This indicates that a downloaded file's cryptographic signature
    does not match the expected signature, suggesting tampering or
    an incomplete download.

    Example:
        raise SignatureValidationError(
            f"GPG signature verification failed for {filename}"
        )
    Nr\rrrrrd�rardc@rZ)�
DownloadErroraRaised when downloading a file from a URL fails.

    This encompasses network errors, HTTP errors, and other issues
    that prevent successfully retrieving a remote resource.

    Example:
        raise DownloadError(f"Failed to download {url}: {reason}")
    Nr\rrrrre�rarec@rZ)�ConfigurationErrora3Raised when required configuration is missing or invalid.

    This typically occurs during build setup when recipes are incomplete
    or environment variables are not properly set.

    Example:
        raise ConfigurationError(
            "Python recipe is missing download configuration"
        )
    Nr\rrrrrf�rarfc@rZ)�
PlatformErrora<Raised when operating on an unsupported platform.

    Relenv supports Linux, macOS, and Windows. This exception is raised
    when attempting operations that are platform-specific or when running
    on an unsupported platform.

    Example:
        raise PlatformError(f"Unsupported platform: {sys.platform}")
    Nr\rrrrrg�rargc@rZ)�BuildCommandErroraRaised when a build command execution fails.

    This indicates that a subprocess (compiler, linker, etc.) returned
    a non-zero exit code during the build process.

    Example:
        raise BuildCommandError(
            f"Build command failed: {' '.join(cmd)}"
        )
    Nr\rrrrrhrarhc@rZ)�MissingDependencyErrora&Raised when a required build dependency is not found.

    This typically occurs when expected files, directories, or system
    packages are missing from the build environment.

    Example:
        raise MissingDependencyError(
            f"Unable to locate {dependency_name}"
        )
    Nr\rrrrriraric@rZ)�RelenvEnvironmentErrora-Raised when there are issues with the relenv environment.

    This occurs when operations require being inside a relenv environment
    but the current environment is not properly configured.

    Example:
        raise RelenvEnvironmentError(
            "Not in a relenv environment"
        )
    Nr\rrrrrj&rarj�pythonr�tplcCs(|�|���}|�d�r|dS|dS)z%
    Return a formatted shebang.
    z'''z

rK)�formatr%�endswith)rkrlZshebangrrr�format_shebang3s
rocCst��}|��S)z%
    Return the current machine.
    )rT�machiner&�rprrr�
build_arch=srrrW�str | os.PathLike[str] | NonecCs"|dur
t�|���}|St}|S)a
    Get the root directory that all other relenv working directories should be based on.

    :param root: An explicitly requested root directory
    :type root: str

    :return: An absolute path to the relenv root working directory
    :rtype: ``pathlib.Path``
    N)r'r(r�
MODULE_DIR)rWr,rrr�	work_rootEs
�ru�namecCs.t|�}|tkr|d|��}|S||}|S)a`
    Get the absolute path to the relenv working directory of the given name.

    :param name: The name of the directory
    :type name: str
    :param root: The root directory that this working directory will be relative to
    :type root: str

    :return: An absolute path to the requested relenv working directory
    :rtype: ``pathlib.Path``
    �_)rurt)rvrWr,rrr�work_dirXs�rxc@s.eZdZdZddd�Zdd
d�Zddd�ZdS)�WorkDirsz�
    Simple class used to hold references to working directories relenv uses relative to a given root.

    :param root: The root of the working directories tree
    :type root: str
    �selfrW�str | os.PathLike[str]rrFcCs\t�|�|_t|_td|j�|_t�|_tdt�|_	tdt�|_
tdt�|_tdt�|_dS)NrR�build�src�logs�download)
r'r(rWrUr?rx�toolchain_configrXrRr|r}r~r)rzrWrrr�__init__tszWorkDirs.__init__�dict[str, pathlib.Path]cCs"|j|j|j|j|j|j|jd�S)z[
        Return an object used for pickling.

        :return: The picklable state
        �rWr�rRr|r}r~rr��rzrrr�__getstate__~s�zWorkDirs.__getstate__�state�Mapping[str, pathlib.Path]cCsJ|d|_|d|_|d|_|d|_|d|_|d|_|d|_dS)	z�
        Unwrap the object returned from unpickling.

        :param state: The state to unpickle
        :type state: dict
        rWr�rRr|r}r~rNr�)rzr�rrr�__setstate__�s





zWorkDirs.__setstate__N)rzryrWr{rrF)rzryrr�)rzryr�r�rrF)r]r^r_r`r�r�r�rrrrryls



rycCstt|��S)z�
    Returns a WorkDirs instance based on the given root.

    :param root: The desired root of relenv's working directories
    :type root: str

    :return: A WorkDirs instance based on the given root
    :rtype: ``relenv.common.WorkDirs``
    )ryrurVrrr�	work_dirs�sr��arch�
str | NonecCsH~tjtdd�tjdkrt�St�}t|d�}||}d}|��r(tt	|��}zddl
m}|d�}WntyG|��rC|YSdYSwt
|d	d�}t
|d
d�}	|dus\t|	�s`td��|jddd�t�|�}
t|
�}|��r}|r}t||�r}|S|��r�t�|�|	t|�t|
��|��s�td
|
�d|����t||�|S)a�
    Get a the toolchain directory, specific to the arch if supplied.

    On Linux, this function will extract the toolchain from ppbt if needed.
    If the toolchain already exists, it will be returned even if ppbt is
    not available (e.g., when running tests on non-Linux platforms that
    patch sys.platform to "linux"). This allows using existing toolchains
    without requiring ppbt to be installed.

    :param arch: The architecture to get the toolchain for
    :type arch: str
    :param root: The root of the relenv working directories to search in
    :type root: str

    :return: The directory holding the toolchain, or None if on Linux and
             the toolchain doesn't exist and ppbt is unavailable
    :rtype: ``pathlib.Path``
    T)�exist_okrrqNr)�
import_modulezppbt.commonZARCHIVE�extract_archivez.ppbt.common missing ARCHIVE or extract_archive)�parentsr�zToolchain archive z did not produce )r!�makedirsrUrSrTrX�get_tripletr6r@r1�	importlibr��ImportError�getattr�callabler[�mkdirr'r(rrE�shutil�rmtreerrQ)r�rWZtoolchain_root�tripletr.rCr�Zppbt_commonZarchive_attr�extract�archive_pathZarchive_metarrr�
get_toolchain�s@

�


r�rp�platcCsX|stj}|s
t�}|dkr|�d�S|dkr|�d�S|dkr%|�d�Std|����)a�
    Get the target triplet for the specified machine and platform.

    If any of the args are None, it will try to deduce what they should be.

    :param machine: The machine for the triplet
    :type machine: str
    :param plat: The platform for the triplet
    :type plat: str

    :raises RelenvException: If the platform is unknown

    :return: The target triplet
    :rtype: str
    rz-macosr
z-winrz
-linux-gnuzUnknown platform )rSrTrrrg)rpr�rrrr��s


r�cCs2|dkrdS|dkrdS|dkrdStd|����)zC
    Convert platform from build to the value of sys.platform.
    z	linux-gnurZmacosr�winr
zUnkown platform )rg)r�rrr�plat_from_triplet
sr��list[tuple[str, str, str]]cCszg}tt�}t�|j�D].\}}}~|D]%}|�d�r9|dd�}|�dd�\}}|�dd�\}	}
|�||	|
f�qq|S)zJ
    Return a list of version, architecture and platforms for builds.
    �.tar.xzNi�����-�)r�rUr!�walkr|rn�split�append)ZbuildsZworking_dirs�root_dir�dirnames�	filenames�filename�	base_name�versionr�r�r�rrr�list_archived_buildss
��r�r�cCs&|st�}tt�}|�d�}|j|S)z�
    Finds a the location of an archived build.

    :param triplet: The build triplet to find
    :type triplet: str

    :return: The location of the archived build
    :rtype: ``pathlib.Path``
    r�)r�r�rUr|)r��dirsrrrr�archived_build(s



r��to_dirr{rc
Cs>t�|�}t|�}t�|�}|�d�r<ddl}t�d�|�|d��}|�t|��Wd�dS1s5wYdSt	d}d}|�d�rOt�d�d	}n-|�d
�r\t�d�d	}n |�d�rit�d
�d}n|�d�rvt�d�d}nt�
d|�tjt|�|d��}	|	�t|��Wd�dS1s�wYdS)z�
    Extract an archive to a specific location.

    :param to_dir: The directory to extract to
    :type to_dir: str
    :param archive: The archive to extract
    :type archive: str
    z.ziprNzFound zip archive�r)�r:gz�r:xz�r:bz2r�z.tgzzFound tgz archiver�z.tar.gzzFound tar.gz archivez.xzzFound xz archiver�z.bz2zFound bz2 archiver�zFound unknown archive type: %s)�mode)
r'r(rrn�zipfilerN�debug�ZipFile�
extractallrrO�tarfiler7)
r�rr�Zarchive_strZto_pathr�Zzip_refZTarReadModeZ	read_type�tarrrrr�9s<
	



��







"�r��url�destcCstj�t�|�tj�|��S)a
    Get the full path to where the url will be downloaded to.

    :param url: The url to donwload
    :type url: str
    :param dest: Where to download the url to
    :type dest: str

    :return: The path to where the url will be downloaded to
    :rtype: str
    )r!r�join�fspath�basename)r�r�rrr�get_download_locationasr���	timestamp�float | None�timeout�floatc
Cs�ddl}ddl}tt�}|j�|�}|r|�d|�|��|d<|��D]
\}}|�	||�q#d}	z4z
|jj
||d�}	Wn ty[}
zt|
�WYd}
~
W|	rU|	�
�dSdSd}
~
wwW|	rc|	�
�dS|	rl|	�
�ww)z+
    Check that the url returns a 200.
    rNz%a, %d %b %Y %H:%M:%S GMTzIf-Modified-Since�r�FT)�time�urllib.requestr=�REQUEST_HEADERS�requestZRequest�strftime�gmtime�itemsZ
add_header�urlopen�	Exception�print�close)r�r�r�r��urllib�headersZreq�k�vZfinrPrrr�	check_urlps4�����
�r���<�fpr�backoff�int�progress_callback�!Callable[[int, int], None] | NonecCs�ddl}ddl}t��}t|d�}d}td|d�D]N}	z|jj||d�}WnA|jj|jj	t
jjfyh}
z,|	|krFt
d|�d|
����tdd|	dd	�}t�d
||
|�t�|�WYd}
~
qd}
~
ww|durtt
d|����t�d|�d}z|j�d
�}
|
r�t|
�}t�d|�|r�|d|�Wnttfy�t�d�YnwzCd}d}|�|�}|r�t|�}||7}t��|dkr�t�d||�t��}|�|�|r�|dkr�|||�|�d�}|s�W|��n|��wt�d|�dS)a
    Fetch the contents of a url.

    This method will store the contents in the given file like object.

    :param progress_callback: Optional callback(downloaded_bytes, total_bytes)
    :type progress_callback: Optional[Callable[[int, int], None]]
    rNr�r��Error fetching url � r�rH�,�*Unable to connect %s (%s); retrying in %ds�Unable to open url �
url opened %szContent-LengthzContent-Length: %d bytesz%Could not parse Content-Length headeri��
z%s > %di(�Download complete %s)�urllib.errorr�r��max�ranger�r��error�	HTTPError�URLError�http�client�RemoteDisconnectedr[�minrNrO�sleep�infor�r#r��
ValueError�	TypeErrorr��read�lenrMr�)r�r�r�r�r�r��last�attempts�response�attemptrP�delayZcontent_lengthZcontent_length_strZ
downloadedr�blockZ
block_sizerrr�	fetch_url�sl
���

��



��r�cCsVddl}ddl}ddl}t|d�}d}td|d�D]N}z|jj||d�}WnA|jj|jj	t
jjfyh}z,||krFt
d|�d|����tdd|dd	�}	t�d
|||	�t�|	�WYd}~qd}~ww|durtt
d|����t�d|�z|��}
|j�d
d���}W|��n|��w|dkr�t�d�|�|
�}
t�d|�|
��S)zn
    Fetch the contents of a url.

    This method will store the contents in the given file like object.
    rNr�r�r�r�r�rHr�r�r�r�zcontent-encoding��gzipzFound gzipped contentr�)r�r�r�r�r�r�r�r�r�r�r�r�r�r[r�rNrOr�r�r�r�r�r#r&r�r��
decompress�decode)r�r�r�r�r�r�r�r�rPr�r?r5rrr�fetch_url_content�sB
���


rT�verbosec	Cs�t||�}|rt�d|�d|���zTzt|d��}t|||||�Wd�n1s,wYWn&tyX}z|rCt�d||�zt�|�W�t	ySY�wd}~wwWt�d|�d|���|St�d|�d|���w)a�
    Download the url to the provided destination.

    This method assumes the last part of the url is a filename. (https://foo.com/bar/myfile.tar.xz)

    :param url: The url to download
    :type url: str
    :param dest: Where to download the url to
    :type dest: str
    :param verbose: Print download url and destination to stdout
    :type verbose: bool
    :param progress_callback: Optional callback(downloaded_bytes, total_bytes)
    :type progress_callback: Optional[Callable[[int, int], None]]

    :raises urllib.error.HTTPError: If the url was unable to be downloaded

    :return: The path to the downloaded content
    :rtype: str
    zDownloading z -> �wbNzUnable to download: %s
%szFinished downloading )
r�rNr�r7r�r�r�r!�unlinkr:)	r�r�rr�r�r��localZfoutrPrrr�download_urls0
�������	�r�argsr�kwargs�subprocess.Popen[str]c	Os�|std��t�dd�tt|d���tj|d<tj|d<d|vr&d|d<tj	d	kr�tj
|i|��}|j}|j}|d
usA|d
urI|�
�td��t��}|�|tj�|�|tj�d}|r�|��D]/\}}~td|j�}	|	��}
|
sxd
}n|
�d�r�|
d
d�}
|	|ur�t�|
�qct�|
�qc|s_n�d#dd�}d$dd�}tj
|i|��}|j}|j}|d
us�|d
ur�|�
�td��t��}
tj|||
dfd�}tj|||
dfd�}tj|||
fd�}|��|��|��	|
��\}}
|dk�rt�|
d
d��n|dk�rt�|
d
d��n|d k�rt�d!�nq�|��|��|��|�
�|jdk�r>t d"�!d�|d����|S)%aV
    Run a command.

    Run the provided command, raising an Exception when the command finishes
    with a non zero exit code.  Arguments are passed through to ``subprocess.run``

    :return: The process result
    :rtype: ``subprocess.CompletedProcess``

    :raises RelenvException: If the command finishes with a non zero exit code
    zNo command provided to runcmdzRunning command: %sr�r�stdout�stderr�universal_newlinesTr
NzProcess pipes are unavailable�IO[str]FrK����stream�
item_queue�"queue.Queue[tuple[int | str, str]]�kindr�rrFcSsNd}t|jd�D]}|dkrn
|�||f�|}qt�d||�|��dS)Nr�zstream close %r %r)�iter�readline�putrNr�r�)rrrZ	last_line�linerrr�enqueue_stream`szruncmd.<locals>.enqueue_stream�processr
cSs|��|�d�dS)N)�xr�)�waitr)rrrrr�enqueue_processnszruncmd.<locals>.enqueue_processr�)�targetrrHrzprocess queue endzBuild cmd '{}' failed)rrrrrr�rrF)rr
rrrrF)"r[rNr�r��mapr�
subprocess�PIPErSrT�Popenrrr�	selectors�DefaultSelector�register�
EVENT_READ�selectr�fileobjrrnr�r��queueZQueue�	threading�Thread�startr#�
returncoderhrm)rr	�pZ
stdout_streamZ
stderr_streamZsel�ok�keyZval1rrrr�q�toZte�tprrrr�runcmd.s�



��





�
r3r��scripts_dir�interpretercCs�t�|�}t�|�}t�|�}z|�|�}Wnty!td��wztjdd�|�|�jD��}W||Sty@td��w)zM
    Return a relativized path to the given scripts_dir and interpreter.
    z$interperter not relative to root_dircss�|]}dVqdS)z..Nr)�.0rrrr�	<genexpr>�s�z'relative_interpreter.<locals>.<genexpr>z$scripts_dir not relative to root_dir)r'r(�relative_tor��parts)r�r4r5�scriptsZinterprWZ	relinterpZ
relscriptsrrr�relative_interpreter�s


���r;�paths�tuple[str, str]cGs@tjj|�}ztj�|�}Wn	tyYnw|tj�|�fS)z1
    Make a normalized path name from paths.
    )r!rr��abspathr:�normcase)r<�dirrrr�makepath�s�rA�sitedir�list[str] | NonecCs�ddl}ddl}tj�|t�|��}g}zt�|�}Wn
ty%YdSwt|dd�}t|dd�}t|dd�|@sBt|dd�|@rDdSz|j	|�
|�dd�}	Wn
tyZYdSw|	��t|	�D]x\}
}|�d	�rlqb|�
�d
krsqbz'|�d�rt|�Wqb|��}t||�\}}
|
|vr�tj�|�r�|�|�Wqbty�td|
d
d�d|�d�tjd�ddl}|jt���D]}|��D]}td|tjd�q�q�tdtjd�Yn	wWd�|SWd�|S1s�wY|S)z'
    Add editable package to path.
    rN�FILE_ATTRIBUTE_HIDDEN�	UF_HIDDEN�st_flags�st_file_attributes�localer4�#r�)zimport zimport	zError processing line r��dz of z:
)�filez  z
Remainder of file ignored)�iorr!rr�r��lstatr:r��
TextIOWrapper�	open_code�	enumerate�
startswithr%�exec�rstriprAr6r�r�r�rSr�	traceback�format_exception�exc_info�
splitlines)rBrvrLr�fullnamer<�stZfile_attr_hiddenZ	uf_hidden�f�nrr@�dircaserT�recordrrr�
addpackage�sl� �


�����
��
��r^�sys_path_entries�
Iterable[str]�	list[str]c

Cs�g}tt�tj���t�tj���h�}|D]%}|D] }zt�|���}|�|�|�t	|��Wqt
y:YqwqdtjvrRtjd�
tj�D]}|�|�qJ|dd�D]#}t�|��d�D]}t||�}|slqb|D]}	|	|vry|�|	�qnqbqX|S)zW
    Sanitize `sys.path` to only include paths relative to the onedir environment.
    Z
PYTHONPATHNz__editable__.*.pth)�tupler'r(rS�prefixr�base_prefixr8r�rr�r!r"r��pathsep�globr^)
r_Z
__sys_pathZ__valid_path_prefixesZ__pathZ__valid_path_prefixZ__resolved_pathZ
known_pathrwr<r-rrr�sanitize_sys_path�s>��
��


���rgc@sneZdZdZddd�Zd d	d
�Zd!dd
�Zed"dd��Zd#dd�Z	d#dd�Z
d#dd�Zd#dd�Zd#dd�Z
dS)$�Versionz
    Version comparisons.
    r?rrrFcCs,|�|�\}}}||_||_||_||_dSr/)�parse_string�major�minor�micro�_data)rzr?rjrkrlrrrr�s

zVersion.__init__rzcCs@|j�}|jdur|d|j��7}|jdur|d|j��7}|S)z$
        Version as string.
        N�.)rjrkrl)rz�resultrrr�__str__s

zVersion.__str__r�cCst|j|j|jf�S)z\
        Hash of the version.

        Hash the major, minor, and micro attributes.
        )�hashrjrkrlr�rrr�__hash__(szVersion.__hash__�"tuple[int, int | None, int | None]cCs�|�d�}t|�dkrt|d�ddfSt|�dkr't|d�t|d�dfSt|�dkr>t|d�t|d�t|d�fStd��)zO
        Parse a version string into major, minor, and micro integers.
        rnr�rNrH�zToo many parts to  parse)r�r�r��RuntimeError)r?r9rrrri0s
"zVersion.parse_string�other�objectrDcCs�t|t�stS|jdurdn|j}|jdurdn|j}|jdur"dn|j}|jdur,dn|j}|jdur6dn|j}|jdur@dn|j}||koN||koN||kS)z'
        Equality comparisons.
        Nr�r<rh�NotImplementedrjrkrl�rzrvZmymajorZmyminorZmymicrorjrkrlrrr�__eq__?s
zVersion.__eq__cCs�t|t�stS|jdurdn|j}|jdurdn|j}|jdur"dn|j}|jdur,dn|j}|jdur6dn|j}|jdur@dn|j}||krIdS||kr]||krSdS||kr]||kr]dSdS)z(
        Less than comparrison.
        NrTFrxrzrrr�__lt__Ms 
zVersion.__lt__cCs�t|t�stS|jdurdn|j}|jdurdn|j}|jdur"dn|j}|jdur,dn|j}|jdur6dn|j}|jdur@dn|j}||krQ||krQ||krQdSdS)z4
        Less than or equal to comparrison.
        NrTFrxrzrrr�__le__bs
zVersion.__le__cC�t|t�stS|�|�S)z+
        Greater than comparrison.
        )r<rhryr}�rzrvrrr�__gt__t�
zVersion.__gt__cCr~)z7
        Greater than or equal to comparrison.
        )r<rhryr|rrrr�__ge__|r�zVersion.__ge__N)r?rrrF)rzrhrr)rzrhrr�)r?rrrs)rzrhrvrwrrD)r]r^r_r`r�rprr�staticmethodrir{r|r}r�r�rrrrrhs






rh)rrrr)rr)r.rrr)rrrr2)rArBrCrBrrD)r.rrCrBrrF)rr)rkrrlrrr)rrr/)rWrsrr)rvrrWrsrr)rWrsrry)NN)r�r�rWrsrr)rpr�r�r�rr)r�rrr)rr�)r�r�rr)r�r{rr{rrF)r�rr�r{rr)Nr�)r�rr�r�r�r�rrD)r�r�N)r�rr�rr�r�r�r�r�r�rrF)r�r�)r�rr�r�r�r�rr)Tr�r�N)r�rr�r{rrDr�r�r�r�r�r�rr)rrr	rrr
)r�r{r4r{r5r{rr)r<r{rr=)rBrrvr{rrC)r_r`rra)br`�
__future__rZhttp.clientr�r8Zloggingr!r'rTr(r"r�rrSr��textwrapr)r��typingrrrrrr�collections.abcr	r
r�__version__Z	getLoggerr]rNr(�__file__r�parentrtZLINUXZWIN32ZDARWINZMACOS_DEVELOPMENT_TARGETr$r0rr-r1r@rErQrXr�ZCHECK_HOSTSZarchesr*ZDEFAULT_DATA_DIRr"r#rU�dedentZSHEBANG_TPL_LINUXZSHEBANG_TPL_MACOSZSHEBANG_TPLr�r[rbrcrdrerfrgrhrirjrorrrurxryr�r�r�r�r�r�r�r�r�r�rrr3r;rAr^rgrhrrrr�<module>s� 


	






�
�	�
	



	�3��?




( �I-�
.
i


6!