HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //proc/self/root/usr/local/lib/python3.10/dist-packages/setuptools/__pycache__/msvc.cpython-310.pyc
o

��h���@sUdZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZddlm
Z
ddlZe
r=ddlmZmZe
sPe��dkrPddlZddlmZnGd	d
�d
�Ze�Zded<Gd
d�d�ZGdd�d�ZGdd�d�ZGdd�de�ZGdd�d�ZdS)zo
Environment info about Microsoft Compilers.

>>> getfixture('windows_only')
>>> ei = EnvironmentInfo('amd64')
�)�annotationsN)�
TYPE_CHECKING�	TypedDict)�unique_everseen)�
LiteralString�NotRequired�Windows)�environc@seZdZdZdZdZdZdS)�winregN)�__name__�
__module__�__qualname__�
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINE�HKEY_CLASSES_ROOT�rr�:/usr/local/lib/python3.10/dist-packages/setuptools/msvc.pyr
 s
r
zdict[str, str]r	c@sheZdZdZe�dd���Zddd�Ze	dd	��Z
d
d�Zdd
�Zdddd�Z
dddd�Zddd�ZdS)�PlatformInfoz�
    Current and Target Architectures information.

    Parameters
    ----------
    arch: str
        Target architecture.
    �processor_architecture��return�NonecCs|���dd�|_dS)N�x64�amd64)�lower�replace�arch)�selfrrrr�__init__5szPlatformInfo.__init__cCs|j|j�d�dd�S)zs
        Return Target CPU architecture.

        Return
        ------
        str
            Target CPU
        �_�N)r�find�rrrr�
target_cpu8s
zPlatformInfo.target_cpucC�
|jdkS)z�
        Return True if target CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        �x86�r$r#rrr�
target_is_x86D�
	zPlatformInfo.target_is_x86cCr%)z�
        Return True if current CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        r&��current_cpur#rrr�current_is_x86Or)zPlatformInfo.current_is_x86F�strcC�0|jdkr	|r	dS|jdkr|rdSd|j��S)uk
        Current platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '†' if architecture is x86.
        x64: bool
            return 'd' and not 'md64' if architecture is amd64.

        Return
        ------
        str
            subfolder: '	arget', or '' (see hidex86 parameter)
        r&rr�\x64�\r*�r�hidex86rrrr�current_dirZ�����
�zPlatformInfo.current_dircCr.)ar
        Target platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '\x86' if architecture is x86.
        x64: bool
            return '\x64' and not '\amd64' if architecture is amd64.

        Return
        ------
        str
            subfolder: '\current', or '' (see hidex86 parameter)
        r&rrr/r0r'r1rrr�
target_dirrr4zPlatformInfo.target_dircCs4|rdn|j}|j|krdS|���dd|�d��S)ap
        Cross platform specific subfolder.

        Parameters
        ----------
        forcex86: bool
            Use 'x86' as current architecture even if current architecture is
            not x86.

        Return
        ------
        str
            subfolder: '' if target architecture is current architecture,
            '\current_target' if not.
        r&rr0r )r+r$r5r)r�forcex86�currentrrr�	cross_dir�s
���zPlatformInfo.cross_dirN�rr)FF�rr-�F)rrr
�__doc__r	�getrr+r�propertyr$r(r,r3r5r8rrrrr)s	

rc@s�eZdZdZejejejejfZ	ddd�Z
ed dd��Zed	d
��Z
edd��Zed
d��Zed dd��Zed dd��Zedd��Zedd��Zed dd��Zd!dd�Zdd�ZdS)"�RegistryInfoz�
    Microsoft Visual Studio related registry information.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    rrcCs
||_dS�N)�pi)r�
platform_inforrrr�s
zRegistryInfo.__init__r-cC�dS)z�
        Microsoft Visual Studio root registry key.

        Return
        ------
        str
            Registry key
        �VisualStudiorr#rrr�visualstudio��
zRegistryInfo.visualstudiocC�tj�|jd�S)z
        Microsoft Visual Studio SxS registry key.

        Return
        ------
        str
            Registry key
        �SxS)�os�path�joinrEr#rrr�sxs��
zRegistryInfo.sxscCrG)z|
        Microsoft Visual C++ VC7 registry key.

        Return
        ------
        str
            Registry key
        �VC7�rIrJrKrLr#rrr�vc�rMzRegistryInfo.vccCrG)z
        Microsoft Visual Studio VS7 registry key.

        Return
        ------
        str
            Registry key
        �VS7rOr#rrr�vs�rMzRegistryInfo.vscCrC)z�
        Microsoft Visual C++ for Python registry key.

        Return
        ------
        str
            Registry key
        zDevDiv\VCForPythonrr#rrr�
vc_for_python�rFzRegistryInfo.vc_for_pythoncCrC)zq
        Microsoft SDK registry key.

        Return
        ------
        str
            Registry key
        zMicrosoft SDKsrr#rrr�
microsoft_sdk�rFzRegistryInfo.microsoft_sdkcCrG)z�
        Microsoft Windows/Platform SDK registry key.

        Return
        ------
        str
            Registry key
        r�rIrJrKrTr#rrr�windows_sdk�rMzRegistryInfo.windows_sdkcCrG)z�
        Microsoft .NET Framework SDK registry key.

        Return
        ------
        str
            Registry key
        �NETFXSDKrUr#rrr�	netfx_sdk
rMzRegistryInfo.netfx_sdkcCrC)z�
        Microsoft Windows Kits Roots registry key.

        Return
        ------
        str
            Registry key
        zWindows Kits\Installed Rootsrr#rrr�windows_kits_rootsrFzRegistryInfo.windows_kits_rootsFcCs(|j��s|r	dnd}tj�d|d|�S)a
        Return key in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        x86: str
            Force x86 software registry.

        Return
        ------
        str
            Registry key
        r�Wow6432Node�Software�	Microsoft)rAr,rIrJrK)r�keyr&�node64rrr�	microsoft"szRegistryInfo.microsoftc	Cs�tj}tj}tj}|j}|jD]f}d}z||||�d|�}Wn'tyE|j��sAz||||d�d|�}Wnty@YYqwYqYnwz'zt�	||�dWW|rZ||�SStyeYnwW|rm||�q|ru||�wwdS)a
        Look for values in registry in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        name: str
            Value name to find.

        Return
        ------
        str
            value
        NrT)
r
�KEY_READ�OpenKey�CloseKeyr_�HKEYS�OSErrorrAr,�QueryValueEx)	rr]�name�key_read�openkey�closekey�ms�hkey�bkeyrrr�lookup5sD

��������
�zRegistryInfo.lookupNr9r:r;)rrr
r<r
rrrrrcrr>rErLrPrRrSrTrVrXrYr_rmrrrrr?�s8
�






r?c@sJeZdZdZe�dd�Ze�dd�Ze�de�Zd=d>d	d
�Z	dd�Z
d
d�Zd?dd�Ze
dd��Zedd��Zedd��Zdd�Zdd�Zed@dd��Zedd ��ZedAd"d#��Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zed2d3��ZedBd5d6��ZedBd7d8��Z dBd9d:�Z!e
dCd;d<��Z"dS)D�
SystemInfoz�
    Microsoft Windows and Visual Studio related system information.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    �WinDirr�ProgramFileszProgramFiles(x86)NrrcCs2||_|jj|_|��|_|p|��|_|_dSr@)�rirA�find_programdata_vs_vers�known_vs_paths�_find_latest_available_vs_ver�vs_ver�vc_ver)r�
registry_inforvrrrrqs

zSystemInfo.__init__cCs>|��}|s|jstj�d��t|�}|�|j�t|�dS)zm
        Find the latest VC version

        Return
        ------
        float
            version
        z%No Microsoft Visual C++ version found���)�find_reg_vs_versrs�	distutils�errors�DistutilsPlatformError�set�update�sorted)r�reg_vc_vers�vc_versrrrrtzs	
�z(SystemInfo._find_latest_available_vs_vercCs^|jj}|jj|jj|jjf}g}t�|jj|�D]�\}}z
t�	|||�dtj
�}Wn	ty3Yqw|�lt�|�\}}}	t
|�D]*}
t�t��tt�||
�d�}||vr^|�|�Wd�n1shwYqCt
|�D](}
t�t��tt�||
��}||vr�|�|�Wd�n1s�wYqrWd�n1s�wYqt|�S)z�
        Find Microsoft Visual Studio versions available in registry.

        Return
        ------
        list of float
            Versions
        rN)rqr_rPrSrR�	itertools�productrcr
rar`rd�QueryInfoKey�range�
contextlib�suppress�
ValueError�float�	EnumValue�append�EnumKeyr)rrj�vckeys�vs_versrkr]rl�subkeys�valuesr �i�verrrrry�s>	�
���
������zSystemInfo.find_reg_vs_vers�dict[float, str]c	
Cs�i}d}zt�|�}Wnty|YSw|D]J}z=tj�||d�}t|ddd��
}t�|�}Wd�n1s;wY|d}t�tj�|d��|||�|d	�<Wqtt	fycYqw|S)
z�
        Find Visual studio 2017+ versions from information in
        "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances".

        Return
        ------
        dict
            float version as key, path as value.
        z9C:\ProgramData\Microsoft\VisualStudio\Packages\_Instancesz
state.json�rtzutf-8)�encodingN�installationPath�
VC\Tools\MSVC�installationVersion)
rI�listdirrdrJrK�open�json�load�_as_float_version�KeyError)	r�vs_versions�
instances_dir�hashed_namesrf�
state_path�
state_file�state�vs_pathrrrrr�s*
����z#SystemInfo.find_programdata_vs_verscCstd�|�d�dd���S)z�
        Return a string version as a simplified float version (major.minor)

        Parameters
        ----------
        version: str
            Version.

        Return
        ------
        float
            version
        �.N�)r�rK�split)�versionrrrr��szSystemInfo._as_float_versioncCs6tj�|jd|jd���}|j�|jj|jd��p|S)zp
        Microsoft Visual Studio directory.

        Return
        ------
        str
            path
        �Microsoft Visual Studio �0.1f)rIrJrK�ProgramFilesx86rurqrmrR)r�defaultrrr�VSInstallDir�s�zSystemInfo.VSInstallDircCs0|��p|��}tj�|�sd}tj�|��|S)zm
        Microsoft Visual C++ directory.

        Return
        ------
        str
            path
        z(Microsoft Visual C++ directory not found)�	_guess_vc�_guess_vc_legacyrIrJ�isdirrzr{r|)rrJ�msgrrr�VCInstallDir�s

zSystemInfo.VCInstallDirc	Cs�|jdkrdSz|j|j}Wnty|j}Ynwtj�|d�}zt�|�d}|�|�|_	tj�||�WSt
tfyDYdSw)zl
        Locate Visual C++ for VS2017+.

        Return
        ------
        str
            path
        �,@rr�rx)rursr�r�rIrJrKr�r�rvrd�
IndexError)r�vs_dir�guess_vcrvrrrr�s
	
��zSystemInfo._guess_vccCsttj�|jd|jd�d��}tj�|jj|jd��}|j�|d�}|r*tj�|d�n|}|j�|jj|jd��p9|S)z{
        Locate Visual C++ for versions prior to 2017.

        Return
        ------
        str
            path
        r�r�z\VC�
installdir�VC)	rIrJrKr�rurqrSrmrP)rr��reg_path�	python_vc�
default_vcrrrr�*s	�zSystemInfo._guess_vc_legacy�tuple[LiteralString, ...]cCsJ|jdkrdS|jdkrdS|jdkrdS|jdkrdS|jd	kr#d
SdS)z�
        Microsoft Windows SDK versions for specified MSVC++ version.

        Return
        ------
        tuple of str
            versions
        �"@)z7.0z6.1z6.0a�$@)z7.1z7.0a�&@)z8.0z8.0a�(@)�8.1z8.1ar�)z10.0r�r�rur#rrr�WindowsSdkVersion@s





zSystemInfo.WindowsSdkVersioncC�|�tj�|jd��S)zt
        Microsoft Windows SDK last version.

        Return
        ------
        str
            version
        �lib)�_use_last_dir_namerIrJrK�
WindowsSdkDirr#rrr�WindowsSdkLastVersionV�
z SystemInfo.WindowsSdkLastVersion�
str | NonecCs<d}|jD]}tj�|jjd|���}|j�|d�}|rnq|r'tj�|�sCtj�|jj|j	d��}|j�|d�}|rCtj�|d�}|rKtj�|�so|jD] }|d|�
d��}d	|��}tj�|j|�}tj�|�rn|}qN|rwtj�|�s�|jD]}d
|��}tj�|j|�}tj�|�r�|}qz|s�tj�|jd�}|S)zn
        Microsoft Windows SDK directory.

        Return
        ------
        str
            path
        r�v�installationfolderr�r��WinSDKNr�zMicrosoft SDKs\Windows Kits\zMicrosoft SDKs\Windows\v�PlatformSDK)
r�rIrJrKrqrVrmr�rSrv�rfindrpr�)r�sdkdirr��locrJ�install_base�intver�drrrr�bs<

�

�

�zSystemInfo.WindowsSdkDirc	Cs�|jdkr
d}d}nd}|jdkrdnd}|jjd|d��d	d
�}d|�d|��}g}|jd
krC|jD]}|tj�|jj	||�g7}q3|j
D]}|tj�|jjd|�d�|�g7}qF|D]}|j�|d�}|rk|Sq\dS)zy
        Microsoft Windows SDK executable directory.

        Return
        ------
        str
            path
        r��#r�(r�TF)rr2r0�-zWinSDK-NetFx�Toolsr�r��Ar�N)
rurAr3r�NetFxSdkVersionrIrJrKrqrXr�rVrm)	r�netfxverrr2�fx�regpathsr�rJ�execpathrrr�WindowsSDKExecutablePath�s&



$�z#SystemInfo.WindowsSDKExecutablePathcCs.tj�|jj|jd�d��}|j�|d�pdS)zl
        Microsoft Visual F# directory.

        Return
        ------
        str
            path
        r�z	\Setup\F#�
productdirr)rIrJrKrqrErurm)rrJrrr�FSharpInstallDir�s
zSystemInfo.FSharpInstallDircCsH|jdkrdnd}|D]}|j�|jjd|���}|r!|pdSqdS)zt
        Microsoft Universal CRT SDK directory.

        Return
        ------
        str
            path
        r�)�10�81r�kitsrootrN)rurqrmrY)r�versr�r�rrr�UniversalCRTSdkDir�s�zSystemInfo.UniversalCRTSdkDircCr�)z�
        Microsoft Universal C Runtime SDK last version.

        Return
        ------
        str
            version
        r�)r�rIrJrKr�r#rrr�UniversalCRTSdkLastVersion�r�z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSdS)z�
        Microsoft .NET Framework SDK versions.

        Return
        ------
        tuple of str
            versions
        r�)	z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rr�r#rrrr��s


���zSystemInfo.NetFxSdkVersioncCs>d}|jD]}tj�|jj|�}|j�|d�}|r|Sq|S)zu
        Microsoft .NET Framework SDK directory.

        Return
        ------
        str
            path
        r�kitsinstallationfolder)r�rIrJrKrqrXrm)rr�r�r�rrr�NetFxSdkDir�s

�zSystemInfo.NetFxSdkDircC�&tj�|jd�}|j�|jjd�p|S)zw
        Microsoft .NET Framework 32bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\Framework�frameworkdir32�rIrJrKrorqrmrP�r�guess_fwrrr�FrameworkDir32�zSystemInfo.FrameworkDir32cCr�)zw
        Microsoft .NET Framework 64bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\Framework64�frameworkdir64r�r�rrr�FrameworkDir64r�zSystemInfo.FrameworkDir64�tuple[str, ...]cC�
|�d�S)z�
        Microsoft .NET Framework 32bit versions.

        Return
        ------
        tuple of str
            versions
        � ��_find_dot_net_versionsr#rrr�FrameworkVersion32#�

zSystemInfo.FrameworkVersion32cCr�)z�
        Microsoft .NET Framework 64bit versions.

        Return
        ------
        tuple of str
            versions
        �@r�r#rrr�FrameworkVersion64/r�zSystemInfo.FrameworkVersion64cCs�|j�|jjd|���}t|d|���}|p|�|d�pd}|jdkr'|dfS|jdkr>|��dd	�d
kr:ddfS|dfS|jd
krEdS|jdkrLdSdS)z�
        Find Microsoft .NET Framework versions.

        Parameters
        ----------
        bits: int
            Platform number of bits: 32 or 64.

        Return
        ------
        tuple of str
            versions
        �frameworkver�FrameworkDirr�rr�zv4.0r�Nr��v4z
v4.0.30319�v3.5r�)r�
v2.0.50727g @)zv3.0rr)rqrmrP�getattrr�rur)r�bits�reg_ver�dot_net_dirr�rrrr�;s

$

z!SystemInfo._find_dot_net_versionscs,��fdd�tt����D�}t|d�pdS)a)
        Return name of the last dir in path or '' if no dir found.

        Parameters
        ----------
        path: str
            Use dirs in this path
        prefix: str
            Use only dirs starting by this prefix

        Return
        ------
        str
            name
        c3s4�|]}tj�tj��|��r|���r|VqdSr@)rIrJr�rK�
startswith)�.0�dir_name�rJ�prefixrr�	<genexpr>js���
�z0SystemInfo._use_last_dir_name.<locals>.<genexpr>Nr)�reversedrIr��next)rJr
�
matching_dirsrr	rr�Ys�zSystemInfo._use_last_dir_namer@r9)rr�)rr��rr�)rr�)r)#rrr
r<r	r=rorpr�rrtryrr�staticmethodr�r>r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrn_s\
	
*



*
$







rnc@s6eZdZUded<ded<ded<ded<ded<dS)	�_EnvironmentDictr-�includer��libpathrJzNotRequired[str | None]�py_vcruntime_redistN)rrr
�__annotations__rrrrrss
rc@sZeZdZdZdCdDdd�Zedd	��Zed
d��Zedd
��Zedd��Z	edd��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zdd�Zed d!��Zed"d#��Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zed2d3��Zed4d5��Zed6d7��ZedEd9d:��ZdFdGd?d@�ZdAdB�Z dS)H�EnvironmentInfoaY
    Return environment variables for specified Microsoft Visual C++ version
    and platform : Lib, Include, Path and libpath.

    This function is compatible with Microsoft Visual C++ 9.0 to 14.X.

    Script created by analysing Microsoft environment configuration files like
    "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ...

    Parameters
    ----------
    arch: str
        Target architecture.
    vc_ver: float
        Required Microsoft Visual C++ version. If not set, autodetect the last
        version.
    vc_min_ver: float
        Minimum Microsoft Visual C++ version.
    NrrrcCsBt|�|_t|j�|_t|j|�|_|j|krd}tj�	|��dS)Nz.No suitable Microsoft Visual C++ version found)
rrAr?rqrn�sirvrzr{r|)rrrv�
vc_min_ver�errrrrr�s

�zEnvironmentInfo.__init__cC�|jjS)zk
        Microsoft Visual Studio.

        Return
        ------
        float
            version
        )rrur#rrrru��
zEnvironmentInfo.vs_vercCr)zp
        Microsoft Visual C++ version.

        Return
        ------
        float
            version
        )rrvr#rrrrv�rzEnvironmentInfo.vc_vercsXddg}�jdkr#�jjddd�}|dg7}|dg7}|d|��g7}�fdd	�|D�S)
zu
        Microsoft Visual Studio Tools.

        Return
        ------
        list of str
            paths
        zCommon7\IDEz
Common7\Toolsr�T�r2rz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance Toolsc�g|]}tj��jj|��qSr�rIrJrKrr��rrJr#rr�
<listcomp>��z+EnvironmentInfo.VSTools.<locals>.<listcomp>)rurAr3)r�paths�arch_subdirrr#r�VSTools�s



zEnvironmentInfo.VSToolscCs$tj�|jjd�tj�|jjd�gS)z�
        Microsoft Visual C++ & Microsoft Foundation Class Includes.

        Return
        ------
        list of str
            paths
        �IncludezATLMFC\Include�rIrJrKrr�r#rrr�
VCIncludes�s�zEnvironmentInfo.VCIncludescsh�jdkr
�jjdd�}n�jjdd�}d|��d|��g}�jdkr+|d|��g7}�fd	d
�|D�S)z�
        Microsoft Visual C++ & Microsoft Foundation Class Libraries.

        Return
        ------
        list of str
            paths
        �.@T�r�r2�Libz
ATLMFC\Libr�z	Lib\storecrrr&rr#rrr �r!z/EnvironmentInfo.VCLibraries.<locals>.<listcomp>)rurAr5)rr#r"rr#r�VCLibraries�s


zEnvironmentInfo.VCLibrariescC�"|jdkrgStj�|jjd�gS)z�
        Microsoft Visual C++ store references Libraries.

        Return
        ------
        list of str
            paths
        r�zLib\store\references)rurIrJrKrr�r#rrr�VCStoreRefs�s

zEnvironmentInfo.VCStoreRefscCs8|j}tj�|jd�g}|jdkrdnd}|j�|�}|r+|tj�|jd|���g7}|jdkrGd|jjdd���}|tj�|j|�g7}|S|jdkr�|jj	�
d	d
���}tj�dd|�d
��}|tj�|j||jjdd��g7}|jj	|jj
kr�|tj�|j||jjdd��g7}|S|tj�|jd�g7}|S)a�
        Microsoft Visual C++ Tools.

        Return
        ------
        list of str
            paths

        When host CPU is ARM, the tools should be found for ARM.

        >>> getfixture('windows_only')
        >>> mp = getfixture('monkeypatch')
        >>> mp.setattr(PlatformInfo, 'current_cpu', 'arm64')
        >>> ei = EnvironmentInfo(arch='irrelevant')
        >>> paths = ei.VCTools
        >>> any('HostARM64' in path for path in paths)
        True
        �
VCPackagesr�TF�Binr�r*r(rr�bin�Hostz%sr))rrIrJrKr�rurAr8r3r+r�upperr5r$)rr�toolsr6r#rJ�host_id�host_dirrrr�VCTools�s2

����	�zEnvironmentInfo.VCToolscCst|jdkr|jjddd�}tj�|jjd|���gS|jjdd�}tj�|jjd�}|j}tj�||�d|���gS)zw
        Microsoft Windows SDK Libraries.

        Return
        ------
        list of str
            paths
        r�Trr+r)r��um)	rurAr5rIrJrKrr��_sdk_subdir)rr#r��libverrrr�OSLibraries-s

zEnvironmentInfo.OSLibrariescCs~tj�|jjd�}|jdkr|tj�|d�gS|jdkr |j}nd}tj�||�d��tj�||�d��tj�||�d��gS)	zu
        Microsoft Windows SDK Include.

        Return
        ------
        list of str
            paths
        rr��glr�r�sharedr8�winrt)rIrJrKrr�rur9)rr�sdkverrrr�
OSIncludesAs


�zEnvironmentInfo.OSIncludescCs�tj�|jjd�}g}|jdkr||j7}|jdkr$|tj�|d�g7}|jdkr[||tj�|jjd�tj�|dd�tj�|d	d�tj�|d
d�tj�|jjdd|jd
�ddd�g7}|S)z}
        Microsoft Windows SDK Libraries Paths.

        Return
        ------
        list of str
            paths
        �
Referencesr�r�zCommonConfiguration\Neutralr��
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContract�
ExtensionSDKszMicrosoft.VCLibsr��CommonConfiguration�neutral)rIrJrKrr�rur;)r�refrrrr�	OSLibpath[s4




���zEnvironmentInfo.OSLibpathcCst|���S)zs
        Microsoft Windows SDK Tools.

        Return
        ------
        list of str
            paths
        )�list�
_sdk_toolsr#rrr�SdkTools�s
zEnvironmentInfo.SdkToolsccs�|jdkr|jdkr
dnd}tj�|jj|�V|j��s4|jjdd�}d|��}tj�|jj|�V|jdvrY|j�	�rAd}n|jjddd	�}d
|��}tj�|jj|�Vn%|jdkr~tj�|jjd�}|jjdd�}|jj
}tj�||�|���V|jjr�|jjVdSdS)z�
        Microsoft Windows SDK Tools paths generator.

        Return
        ------
        generator of str
            paths
        r(r�r0zBin\x86Tr))r�r�rrzBin\NETFX 4.0 ToolsN)rurIrJrKrr�rAr,r3r(r�r�)r�bin_dirr#rJr?rrrrI�s,�
	





�zEnvironmentInfo._sdk_toolscC�|jj}|r|�d�SdS)zu
        Microsoft Windows SDK version subdir.

        Return
        ------
        str
            subdir
        r0r)rr��r�ucrtverrrrr9��
zEnvironmentInfo._sdk_subdircCs"|jdkrgStj�|jjd�gS)zs
        Microsoft Windows SDK Setup.

        Return
        ------
        list of str
            paths
        r��Setup)rurIrJrKrr�r#rrr�SdkSetup��

zEnvironmentInfo.SdkSetupcs�|j}|j�|jdkrd}|��o|��}n|��p|��}|jdkp)|jdk}g}|r:|�fdd��jD�7}|rH|�fdd��jD�7}|S)zv
        Microsoft .NET Framework Tools.

        Return
        ------
        list of str
            paths
        r�Trc�g|]
}tj��j|��qSr)rIrJrKr��rr��rrrr ���z+EnvironmentInfo.FxTools.<locals>.<listcomp>crSr)rIrJrKr�rTrUrrr �rV)	rArrur(r,r+r$r�r�)rrA�	include32�	include64r4rrUr�FxTools�s"

��zEnvironmentInfo.FxToolscCs>|jdks	|jjsgS|jjdd�}tj�|jjd|���gS)z~
        Microsoft .Net Framework SDK Libraries.

        Return
        ------
        list of str
            paths
        r�Tr)zlib\um)rurr�rAr5rIrJrK)rr#rrr�NetFxSDKLibraries�s
z!EnvironmentInfo.NetFxSDKLibrariescCs*|jdks	|jjsgStj�|jjd�gS)z}
        Microsoft .Net Framework SDK Includes.

        Return
        ------
        list of str
            paths
        r�z
include\um)rurr�rIrJrKr#rrr�NetFxSDKIncludes�s
z EnvironmentInfo.NetFxSDKIncludescCstj�|jjd�gS)z�
        Microsoft Visual Studio Team System Database.

        Return
        ------
        list of str
            paths
        z
VSTSDB\Deployrr#rrr�VsTDbs
zEnvironmentInfo.VsTDbcCs�|jdkrgS|jdkr|jj}|jjdd�}n|jj}d}d|jd�d|��}tj�||�g}|jdkr@|tj�||d	�g7}|S)
zn
        Microsoft Build Engine.

        Return
        ------
        list of str
            paths
        r�r(Tr*rzMSBuild\r�z\bin�Roslyn)	rurr�rAr3r�rIrJrK)r�	base_pathr#rJ�buildrrr�MSBuilds



zEnvironmentInfo.MSBuildcCr-)zt
        Microsoft HTML Help Workshop.

        Return
        ------
        list of str
            paths
        r�zHTML Help Workshop)rurIrJrKrr�r#rrr�HTMLHelpWorkshop4rRz EnvironmentInfo.HTMLHelpWorkshopcCsN|jdkrgS|jjdd�}tj�|jjd�}|j}tj�||�d|���gS)z�
        Microsoft Universal C Runtime SDK Libraries.

        Return
        ------
        list of str
            paths
        r�Tr)r��ucrt)	rurAr5rIrJrKrr��_ucrt_subdir)rr#r�rNrrr�
UCRTLibrariesCs

zEnvironmentInfo.UCRTLibrariescCs8|jdkrgStj�|jjd�}tj�||j�d��gS)z�
        Microsoft Universal C Runtime SDK Include.

        Return
        ------
        list of str
            paths
        r�rrb)rurIrJrKrr�rc)rrrrr�UCRTIncludesUs

zEnvironmentInfo.UCRTIncludescCrL)z�
        Microsoft Universal C Runtime SDK version subdir.

        Return
        ------
        str
            subdir
        r0r)rr�rMrrrrcerOzEnvironmentInfo._ucrt_subdircCs$d|jkrdkr
gS|jjgS)zk
        Microsoft Visual F#.

        Return
        ------
        list of str
            paths
        r�r�)rurr�r#rrr�FSharprs
�
zEnvironmentInfo.FSharpr�cs�d|j�d��|jjdd��d��g}|jj}tj�|�	dd��}tj�
|�r>tj�|t�|�d�}||tj�|d	�g7}|tj�|d
�g7}d|jd�d
�dt
|j�d�d
�f}��fdd�t�||�D�}tttjj|�d�S)z{
        Microsoft Visual C++ runtime redistributable dll.

        Returns the first suitable path found or None.
        �	vcruntimez0.dllTr)r0z\Toolsz\Redistrx�onecore�redistzMicrosoft.VC�
z.CRTc3s&�|]\}}tj�|�|��VqdSr@)rIrJrK)rr
�crt_dir�r#rgrrr�s
��
�z2EnvironmentInfo.VCRuntimeRedist.<locals>.<genexpr>N)rvrAr5�striprr�rIrJ�dirnamerr�rKr��intrur�r�r
�filter�isfile)r�prefixes�
tools_path�redist_path�crt_dirs�candidate_pathsrrlr�VCRuntimeRedist�s �
�zEnvironmentInfo.VCRuntimeRedistT�exists�boolrcCs�t|�d|j|j|j|jg|�|�d|j|j|j|j	|j
g|�|�d|j|j|j|jg|�|�d|j
|j|j|j|j|j|j|j|jg	|�d�}|jdkrU|jrU|j|d<|S)z�
        Return environment dict.

        Parameters
        ----------
        exists: bool
            It True, only return existing paths.

        Return
        ------
        dict
            environment
        rr�rrJ)rr�rrJ�r)r�_build_pathsr'r@rer[r,r;rYrdrZr.rGr7r$r\rJrQr`rarfrurw)rrx�envrrr�
return_env�sV��
������+
zEnvironmentInfo.return_envc
Csxtj�|�}t�|d��tj�}t�||�}|r!tt	tj
j|��n|}|s2|���d�}t
j�|��t|�}	tj�|	�S)aC
        Given an environment variable name and specified paths,
        return a pathsep-separated string of paths containing
        unique, extant, directories from those paths and from
        the environment variable. Raise an error if no paths
        are resolved.

        Parameters
        ----------
        name: str
            Environment variable name
        spec_path_lists: list of str
            Paths
        exists: bool
            It True, only return existing paths.

        Return
        ------
        str
            Pathsep-separated paths
        rz environment variable is empty)r��chain�
from_iterabler	r=r�rI�pathseprHrprJr�r3rzr{r|rrK)
rrf�spec_path_listsrx�
spec_paths�	env_pathsr"�extant_pathsr��unique_pathsrrrr{�szEnvironmentInfo._build_paths)Nrr9r)T)rxryrr)!rrr
r<rr>rurvr$r'r,r.r7r;r@rGrJrIr9rQrYrZr[r\r`rardrercrfrwr}r{rrrrr{sl	






2


'
#











"=r)r<�
__future__rr�r�r�rI�os.path�platform�typingrr�more_itertoolsr�distutils.errorsrz�typing_extensionsrr�systemr
r	�dictrrr?rnrrrrrr�<module>s8y>