Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

¥‘“*ÀMã@s’dZddlZddlmZddlmZmZddlmZm	Z	m
Z
mZddlZddl
Z
ddlZddlZddlZddlZddlmZddlmZdd	lmZe ¡d
kr¶ddlZddlmZnGdd
„d
ƒZeƒZeejjfZ yddl!m"Z"Wne k
rúYnXdd„Z#d/dd„Z$dd„Z%dd„Z&dddddœZ'dd„Z(dd„Z)d d!„Z*d"d#„Z+d0d%d&„Z,Gd'd(„d(ƒZ-Gd)d*„d*ƒZ.Gd+d,„d,ƒZ/Gd-d.„d.ƒZ0dS)1a
Improved support for Microsoft Visual C++ compilers.

Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
    Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
    Microsoft Windows SDK 6.1 (x86, x64, ia64)
    Microsoft Windows SDK 7.0 (x86, x64, ia64)

Microsoft Visual C++ 10.0:
    Microsoft Windows SDK 7.1 (x86, x64, ia64)

Microsoft Visual C++ 14.X:
    Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
    Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
    Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64)

This may also support compilers shipped with compatible Visual Studio versions.
éN)Úopen)ÚlistdirÚpathsep)ÚjoinÚisfileÚisdirÚdirname)Ú
LegacyVersion)Úunique_everseené)Ú
get_unpatchedÚWindows)Úenvironc@seZdZdZdZdZdZdS)ÚwinregN)Ú__name__Ú
__module__Ú__qualname__Ú
HKEY_USERSÚHKEY_CURRENT_USERÚHKEY_LOCAL_MACHINEÚHKEY_CLASSES_ROOT©rrúŽ/build/wlanpi-profiler-7At3M6/wlanpi-profiler-1.0.10/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/setuptools/msvc.pyr+sr)ÚRegcCs’d}|d|f}yt |d¡}WnJtk
rjy|d|f}t |d¡}Wntk
rdd}YnXYnX|r†t|dƒ}t|ƒr†|Sttƒ|ƒS)aÍ
    Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone
    compiler build for Python
    (VCForPython / Microsoft Visual C++ Compiler for Python 2.7).

    Fall back to original behavior when the standalone compiler is not
    available.

    Redirect the path of "vcvarsall.bat".

    Parameters
    ----------
    version: float
        Required Microsoft Visual C++ version.

    Return
    ------
    str
        vcvarsall.bat path
    z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1fÚÚ
installdirzWow6432Node\Nz
vcvarsall.bat)rÚ	get_valueÚKeyErrorrrrÚmsvc9_find_vcvarsall)ÚversionZvc_baseÚkeyÚ
productdirÚ	vcvarsallrrrrBs
rÚx86c
OsŽyttƒ}|||f|ž|ŽStjjk
r2Yntk
rDYnXyt||ƒ ¡Stjjk
rˆ}zt|||ƒ‚Wdd}~XYnXdS)ao
    Patched "distutils.msvc9compiler.query_vcvarsall" for support extra
    Microsoft Visual C++ 9.0 and 10.0 compilers.

    Set environment without use of "vcvarsall.bat".

    Parameters
    ----------
    ver: float
        Required Microsoft Visual C++ version.
    arch: str
        Target architecture.

    Return
    ------
    dict
        environment
    N)	rÚmsvc9_query_vcvarsallÚ	distutilsÚerrorsÚDistutilsPlatformErrorÚ
ValueErrorÚEnvironmentInfoÚ
return_envÚ_augment_exception)ÚverÚarchÚargsÚkwargsÚorigÚexcrrrr$lsr$cCsðyt tjddtjtjB¡}Wntk
r2dSXd}d}|¢xšt ¡D]Ž}yt ||¡\}}}Wntk
r|PYnX|rL|tj	krLt
|ƒrLytt|ƒƒ}Wnt
tfk
r¾wLYnX|dkrL||krL||}}qLWWdQRX||fS)z0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7r)NNNé)rÚOpenKeyrÚKEY_READZKEY_WOW64_32KEYÚOSErrorÚ	itertoolsÚcountÚ	EnumValueÚREG_SZrÚintÚfloatr(Ú	TypeError)r Úbest_versionÚbest_dirÚiÚvZvc_dirZvtrrrrÚ_msvc14_find_vc2015’s0rAcCsšt d¡pt d¡}|sdSy>t t|dddƒddd	d
dd
dd
dddg¡jddd ¡}Wntjtt	fk
rvdSXt|dddƒ}t
|ƒr–d|fSdS)a€Python 3.8 "distutils/_msvccompiler.py" backport

    Returns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    zProgramFiles(x86)ÚProgramFiles)NNzMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez-requiresAnyz	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpressz	-propertyÚinstallationPathz	-productsÚ*ÚmbcsÚstrict)Úencodingr&ÚVCZ	AuxiliaryZBuildé)rÚgetÚ
subprocessÚcheck_outputrÚdecodeÚstripÚCalledProcessErrorr5ÚUnicodeDecodeErrorr)ÚrootÚpathrrrÚ_msvc14_find_vc2017°s(
rSÚx64ÚarmÚarm64)r#Z	x86_amd64Zx86_armZ	x86_arm64c	
Csâtƒ\}}d}|tkr t|}nd|kr,dnd}|rŠt|ddddd|d	d
ƒ	}yddl}|j|dd
d}Wntttfk
rˆd}YnX|s¬tƒ\}}|r¬t|d|dd
ƒ}|s´dSt|dƒ}t|ƒsÊdS|rÖt|ƒsÚd}||fS)z0Python 3.8 "distutils/_msvccompiler.py" backportNÚamd64rTr#z..ÚredistZMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT)Ú	recursiveéÿÿÿÿzMicrosoft.VC140.CRT)NNz
vcvarsall.bat)	rSÚPLAT_SPEC_TO_RUNTIMErÚglobÚImportErrorr5ÚLookupErrorrAr)	Ú	plat_specÚ_r>Ú	vcruntimeZvcruntime_platZvcredistr\r=r"rrrÚ_msvc14_find_vcvarsallÝs6




rbc
CsÄdtkrdd„t ¡DƒSt|ƒ\}}|s6tj d¡‚y&tjd ||¡tj	dj
ddd	}Wn:tjk
r–}ztj d
 |j¡¡|‚Wdd}~XYnXdd„d
d„| 
¡DƒDƒ}|rÀ||d<|S)z0Python 3.8 "distutils/_msvccompiler.py" backportZDISTUTILS_USE_SDKcSsi|]\}}|| ¡“qSr)Úlower)Ú.0r Úvaluerrrú
<dictcomp>sz&_msvc14_get_vc_env.<locals>.<dictcomp>zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)Ústderrzutf-16leÚreplace)r&zError executing {}NcSs$i|]\}}}|r|r|| ¡“qSr)rc)rdr r`rerrrrfscss|]}| d¡VqdS)ú=N)Ú	partition)rdÚlinerrrú	<genexpr>sz%_msvc14_get_vc_env.<locals>.<genexpr>Úpy_vcruntime_redist)rÚitemsrbr%r&r'rKrLÚformatÚSTDOUTrMrOÚcmdÚ
splitlines)r_r"raÚoutr1ÚenvrrrÚ_msvc14_get_vc_envs*

ruc
Cs@yt|ƒStjjk
r:}zt|dƒ‚Wdd}~XYnXdS)a*
    Patched "distutils._msvccompiler._get_vc_env" for support extra
    Microsoft Visual C++ 14.X compilers.

    Set environment without use of "vcvarsall.bat".

    Parameters
    ----------
    plat_spec: str
        Target architecture.

    Return
    ------
    dict
        environment
    g,@N)rur%r&r'r+)r_r1rrrÚmsvc14_get_vc_env(s

rvcOsBdtjkr4ddl}t|jƒtdƒkr4|jjj||ŽStt	ƒ||ŽS)z¦
    Patched "distutils._msvccompiler.gen_lib_options" for fix
    compatibility between "numpy.distutils" and "distutils._msvccompiler"
    (for Numpy < 1.11.2)
    znumpy.distutilsrNz1.11.2)
ÚsysÚmodulesZnumpyr	Ú__version__r%Z	ccompilerZgen_lib_optionsrÚmsvc14_gen_lib_options)r.r/ÚnprrrrzBs

rzrcCs |jd}d| ¡ks"d| ¡kr”d}|jftƒŽ}d}|dkrf| ¡ d¡dkr\|d	7}q”|d
7}n.|dkr„|d7}||d
7}n|dkr”|d7}|f|_dS)zl
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    rr"zvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%dg"@Zia64rZz( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27g$@z* Get it with "Microsoft Windows SDK 7.1": iW g,@zd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/N)r.rcroÚlocalsÚfind)r1rr-ÚmessageÚtmplZ
msdownloadrrrr+Os


r+c@sbeZdZdZe dd¡ ¡Zdd„Ze	dd„ƒZ
dd	„Zd
d„Zdd
d„Z
ddd„Zddd„ZdS)ÚPlatformInfoz
    Current and Target Architectures information.

    Parameters
    ----------
    arch: str
        Target architecture.
    Zprocessor_architecturercCs| ¡ dd¡|_dS)NrTrW)rcrhr-)Úselfr-rrrÚ__init__szPlatformInfo.__init__cCs|j|j d¡dd…S)zs
        Return Target CPU architecture.

        Return
        ------
        str
            Target CPU
        r`rN)r-r})rrrrÚ
target_cpu‚s
zPlatformInfo.target_cpucCs
|jdkS)z‡
        Return True if target CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        r#)rƒ)rrrrÚ
target_is_x86Žs	zPlatformInfo.target_is_x86cCs
|jdkS)zˆ
        Return True if current CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        r#)Úcurrent_cpu)rrrrÚcurrent_is_x86™s	zPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|jS)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#rrWz\x64z\%s)r…)rÚhidex86rTrrrÚcurrent_dir¤szPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|jS)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#rrWz\x64z\%s)rƒ)rr‡rTrrrÚ
target_dirºszPlatformInfo.target_dircCs0|rdn|j}|j|krdS| ¡ dd|¡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#rú\z\%s_)r…rƒr‰rh)rÚforcex86ÚcurrentrrrÚ	cross_dirÐszPlatformInfo.cross_dirN)FF)FF)F)rrrÚ__doc__rrJrcr…r‚Úpropertyrƒr„r†rˆr‰rrrrrr€ts

r€c@sªeZdZdZejejejejfZ	dd„Z
edd„ƒZedd„ƒZ
edd	„ƒZed
d„ƒZedd
„ƒZedd„ƒZedd„ƒZedd„ƒZedd„ƒZddd„Zdd„ZdS)ÚRegistryInfozŸ
    Microsoft Visual Studio related registry information.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    cCs
||_dS)N)Úpi)rZ
platform_inforrrr‚õszRegistryInfo.__init__cCsdS)z€
        Microsoft Visual Studio root registry key.

        Return
        ------
        str
            Registry key
        ZVisualStudior)rrrrÚvisualstudioøs
zRegistryInfo.visualstudiocCst|jdƒS)z
        Microsoft Visual Studio SxS registry key.

        Return
        ------
        str
            Registry key
        ZSxS)rr’)rrrrÚsxss
zRegistryInfo.sxscCst|jdƒS)z|
        Microsoft Visual C++ VC7 registry key.

        Return
        ------
        str
            Registry key
        ZVC7)rr“)rrrrÚvcs
zRegistryInfo.vccCst|jdƒS)z
        Microsoft Visual Studio VS7 registry key.

        Return
        ------
        str
            Registry key
        ZVS7)rr“)rrrrÚvss
zRegistryInfo.vscCsdS)zƒ
        Microsoft Visual C++ for Python registry key.

        Return
        ------
        str
            Registry key
        zDevDiv\VCForPythonr)rrrrÚ
vc_for_python(s
zRegistryInfo.vc_for_pythoncCsdS)zq
        Microsoft SDK registry key.

        Return
        ------
        str
            Registry key
        zMicrosoft SDKsr)rrrrÚ
microsoft_sdk4s
zRegistryInfo.microsoft_sdkcCst|jdƒS)z‚
        Microsoft Windows/Platform SDK registry key.

        Return
        ------
        str
            Registry key
        r
)rr—)rrrrÚwindows_sdk@s
zRegistryInfo.windows_sdkcCst|jdƒS)z€
        Microsoft .NET Framework SDK registry key.

        Return
        ------
        str
            Registry key
        ZNETFXSDK)rr—)rrrrÚ	netfx_sdkLs
zRegistryInfo.netfx_sdkcCsdS)z€
        Microsoft Windows Kits Roots registry key.

        Return
        ------
        str
            Registry key
        zWindows Kits\Installed Rootsr)rrrrÚwindows_kits_rootsXs
zRegistryInfo.windows_kits_rootsFcCs$|j ¡s|rdnd}td|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
        rZWow6432NodeZSoftwareÚ	Microsoft)r‘r†r)rr r#Znode64rrrÚ	microsoftdszRegistryInfo.microsoftc	
Csàtj}tj}tj}|j}xÂ|jD]¸}d}y||||ƒd|ƒ}WnZttfk
r˜|j 	¡s’y||||dƒd|ƒ}Wq”ttfk
rŽw Yq”Xnw YnXz.yt 
||¡dSttfk
rÄYnXWd|rÖ||ƒXq WdS)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)rr4r3ÚCloseKeyrœÚHKEYSr5ÚIOErrorr‘r†ÚQueryValueEx)	rr ÚnameZkey_readZopenkeyZclosekeyÚmsÚhkeyÚbkeyrrrÚlookupws*


zRegistryInfo.lookupN)F)rrrrŽrrrrrržr‚rr’r“r”r•r–r—r˜r™ršrœr¥rrrrrçs"
rc@s<eZdZdZe dd¡Ze dd¡Ze de¡Zd7dd„Z	d	d
„Z
dd„Zd
d„Ze
dd„ƒZedd„ƒZedd„ƒZdd„Zdd„Zedd„ƒZedd„ƒZedd„ƒZedd „ƒZed!d"„ƒZed#d$„ƒZed%d&„ƒZed'd(„ƒZed)d*„ƒZed+d,„ƒZed-d.„ƒZed/d0„ƒZed1d2„ƒZ d3d4„Z!e
d8d5d6„ƒZ"dS)9Ú
SystemInfozê
    Microsoft Windows and Visual Studio related system information.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    ÚWinDirrrBzProgramFiles(x86)NcCs2||_|jj|_| ¡|_|p$| ¡|_|_dS)N)Úrir‘Úfind_programdata_vs_versÚknown_vs_pathsÚ_find_latest_available_vs_verÚvs_verÚvc_ver)rZ
registry_infor­rrrr‚²s

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 foundrZ)Úfind_reg_vs_versrªr%r&r'ÚsetÚupdateÚsorted)rZreg_vc_versZvc_versrrrr«¼s	
z(SystemInfo._find_latest_available_vs_vercCs:|jj}|jj|jj|jjf}g}xt |jj|¡D]ø\}}yt 	|||ƒdtj
¡}Wnttfk
rrw6YnX|°t 
|¡\}}}	xLt|ƒD]@}
t t¡,tt ||
¡dƒ}||krÊ| |¡WdQRXq”WxJt|ƒD]>}
t t¡*tt ||
¡ƒ}||kr| |¡WdQRXqâWWdQRXq6Wt|ƒS)z˜
        Find Microsoft Visual Studio versions available in registry.

        Return
        ------
        list of float
            Versions
        rN)r¨rœr”r–r•r6Úproductržrr3r4r5rŸZQueryInfoKeyÚrangeÚ
contextlibÚsuppressr(r;r8ÚappendÚEnumKeyr±)rr¢ZvckeysZvs_versr£r r¤ZsubkeysÚvaluesr`r?r,rrrr®Ïs*	
&zSystemInfo.find_reg_vs_versc	Csºi}d}yt|ƒ}Wnttfk
r,|SXx†|D]~}y\t||dƒ}t|ddd}t |¡}WdQRX|d}tt|dƒƒ||| |d	¡<Wq4tttfk
r°w4Yq4Xq4W|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)rGNrCz
VC\Tools\MSVCZinstallationVersion)	rr5rŸrrÚjsonÚloadÚ_as_float_versionr)	rZvs_versionsZ
instances_dirZhashed_namesr¡Z
state_pathZ
state_fileÚstateZvs_pathrrrr©î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;rÚsplit)rrrrr¼szSystemInfo._as_float_versioncCs.t|jd|jƒ}|j |jjd|j¡p,|S)zp
        Microsoft Visual Studio directory.

        Return
        ------
        str
            path
        zMicrosoft Visual Studio %0.1fz%0.1f)rÚProgramFilesx86r¬r¨r¥r•)rÚdefaultrrrÚVSInstallDir)szSystemInfo.VSInstallDircCs,| ¡p| ¡}t|ƒs(d}tj |¡‚|S)zm
        Microsoft Visual C++ directory.

        Return
        ------
        str
            path
        z(Microsoft Visual C++ directory not found)Ú	_guess_vcÚ_guess_vc_legacyrr%r&r')rrRÚmsgrrrÚVCInstallDir:s

zSystemInfo.VCInstallDirc
Cs†|jdkrdSy|j|j}Wntk
r8|j}YnXt|dƒ}y"t|ƒd}| |¡|_t||ƒStt	t
fk
r€dSXdS)zl
        Locate Visual C++ for VS2017+.

        Return
        ------
        str
            path
        g,@rz
VC\Tools\MSVCrZN)r¬rªrrÃrrr¼r­r5rŸÚ
IndexError)rZvs_dirZguess_vcr­rrrrÄLs	


zSystemInfo._guess_vccCsbt|jd|jƒ}t|jjd|jƒ}|j |d¡}|rBt|dƒn|}|j |jjd|j¡p`|S)z{
        Locate Visual C++ for versions prior to 2017.

        Return
        ------
        str
            path
        z Microsoft Visual Studio %0.1f\VCz%0.1frrH)rrÁr¬r¨r–r¥r”)rrÂZreg_pathZ	python_vcZ
default_vcrrrrÅjs	zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jdkr8dS|jd	krFd
SdS)z—
        Microsoft Windows SDK versions for specified MSVC++ version.

        Return
        ------
        tuple of str
            versions
        g"@)z7.0z6.1z6.0ag$@)z7.1z7.0ag&@)z8.0z8.0ag(@)z8.1z8.1ag,@)z10.0z8.1N)r¬)rrrrÚWindowsSdkVersion~s





zSystemInfo.WindowsSdkVersioncCs| t|jdƒ¡S)zt
        Microsoft Windows SDK last version.

        Return
        ------
        str
            version
        Úlib)Ú_use_last_dir_namerÚ
WindowsSdkDir)rrrrÚWindowsSdkLastVersion“s
z SystemInfo.WindowsSdkLastVersioncCsd}x4|jD]*}t|jjd|ƒ}|j |d¡}|rPqW|rFt|ƒsvt|jjd|jƒ}|j |d¡}|rvt|dƒ}|r‚t|ƒsÄx@|jD]6}|d| d¡…}d	|}t|j	|ƒ}t|ƒrŠ|}qŠW|rÒt|ƒsx.|jD]$}d
|}t|j	|ƒ}t|ƒrÚ|}qÚW|st|j
dƒ}|S)zn
        Microsoft Windows SDK directory.

        Return
        ------
        str
            path
        rzv%sÚinstallationfolderz%0.1frZWinSDKNr¾zMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZPlatformSDK)rÉrr¨r˜r¥rr–r­ÚrfindrBrÇ)rÚsdkdirr,ÚlocrRÚinstall_baseZintverÚdrrrr̟s6

zSystemInfo.WindowsSdkDirc	CsÔ|jdkrd}d}n&d}|jdkr&dnd}|jjd|d}d	|| d
d¡f}g}|jdkr‚x$|jD]}|t|jj||ƒg7}qdWx(|jD]}|t|jj	d
||ƒg7}qŠWx"|D]}|j 
|d¡}|r²|Sq²WdS)zy
        Microsoft Windows SDK executable directory.

        Return
        ------
        str
            path
        g&@é#ré(g(@TF)rTr‡zWinSDK-NetFx%dTools%srŠú-g,@zv%sArÎN)r¬r‘rˆrhÚNetFxSdkVersionrr¨r™rÉr˜r¥)	rZnetfxverr-r‡ZfxZregpathsr,rRZexecpathrrrÚWindowsSDKExecutablePathÊs"


z#SystemInfo.WindowsSDKExecutablePathcCs&t|jjd|jƒ}|j |d¡p$dS)zl
        Microsoft Visual F# directory.

        Return
        ------
        str
            path
        z%0.1f\Setup\F#r!r)rr¨r’r¬r¥)rrRrrrÚFSharpInstallDirís
zSystemInfo.FSharpInstallDircCsF|jdkrdnd}x.|D]&}|j |jjd|¡}|r|p<dSqWdS)zt
        Microsoft Universal CRT SDK directory.

        Return
        ------
        str
            path
        g,@)Ú10Z81rz
kitsroot%srN)r¬r¨r¥rš)rÚversr,rÐrrrÚUniversalCRTSdkDirús

zSystemInfo.UniversalCRTSdkDircCs| t|jdƒ¡S)z€
        Microsoft Universal C Runtime SDK last version.

        Return
        ------
        str
            version
        rÊ)rËrrÜ)rrrrÚUniversalCRTSdkLastVersions
z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSdS)z
        Microsoft .NET Framework SDK versions.

        Return
        ------
        tuple of str
            versions
        g,@)	z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5r)r¬)rrrrr×szSystemInfo.NetFxSdkVersioncCs:d}x0|jD]&}t|jj|ƒ}|j |d¡}|rPqW|S)zu
        Microsoft .NET Framework SDK directory.

        Return
        ------
        str
            path
        rZkitsinstallationfolder)r×rr¨r™r¥)rrÐr,rÑrrrÚNetFxSdkDir*s
zSystemInfo.NetFxSdkDircCs"t|jdƒ}|j |jjd¡p |S)zw
        Microsoft .NET Framework 32bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\FrameworkZframeworkdir32)rr§r¨r¥r”)rÚguess_fwrrrÚFrameworkDir32<szSystemInfo.FrameworkDir32cCs"t|jdƒ}|j |jjd¡p |S)zw
        Microsoft .NET Framework 64bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\Framework64Zframeworkdir64)rr§r¨r¥r”)rrßrrrÚFrameworkDir64LszSystemInfo.FrameworkDir64cCs
| d¡S)zƒ
        Microsoft .NET Framework 32bit versions.

        Return
        ------
        tuple of str
            versions
        é )Ú_find_dot_net_versions)rrrrÚFrameworkVersion32\s
zSystemInfo.FrameworkVersion32cCs
| d¡S)zƒ
        Microsoft .NET Framework 64bit versions.

        Return
        ------
        tuple of str
            versions
        é@)rã)rrrrÚFrameworkVersion64hs
zSystemInfo.FrameworkVersion64cCs”|j |jjd|¡}t|d|ƒ}|p6| |d¡p6d}|jdkrJ|dfS|jdkrt| ¡dd	…d
krldn|dfS|jd
kr‚dS|jdkrdSdS)zê
        Find Microsoft .NET Framework versions.

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

        Return
        ------
        tuple of str
            versions
        zframeworkver%dzFrameworkDir%dr@rg(@zv4.0g$@Nr¿Zv4z
v4.0.30319zv3.5g"@)zv3.5z
v2.0.50727g @)zv3.0z
v2.0.50727)r¨r¥r”ÚgetattrrËr¬rc)rÚbitsZreg_verZdot_net_dirr,rrrrãts

 

z!SystemInfo._find_dot_net_versionscs*‡‡fdd„ttˆƒƒDƒ}t|dƒp(dS)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
        c3s*|]"}ttˆ|ƒƒr| ˆ¡r|VqdS)N)rrÚ
startswith)rdÚdir_name)rRÚprefixrrrl£sz0SystemInfo._use_last_dir_name.<locals>.<genexpr>Nr)ÚreversedrÚnext)rRrëZ
matching_dirsr)rRrërrˑszSystemInfo._use_last_dir_name)N)r)#rrrrŽrrJr§rBrÁr‚r«r®r©Ústaticmethodr¼rrÃrÇrÄrÅrÉrÍrÌrØrÙrÜrÝr×rÞràrárärærãrËrrrrr¦ s:


*+#
r¦c@sTeZdZdZd=dd„Zedd„ƒZedd	„ƒZed
d„ƒZedd
„ƒZ	edd„ƒZ
edd„ƒZedd„ƒZedd„ƒZ
edd„ƒZedd„ƒZedd„ƒZdd„Zedd„ƒZed d!„ƒZed"d#„ƒZed$d%„ƒZed&d'„ƒZed(d)„ƒZed*d+„ƒZed,d-„ƒZed.d/„ƒZed0d1„ƒZed2d3„ƒZed4d5„ƒZed6d7„ƒZd>d9d:„Zd;d<„Z dS)?r)aY
    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.
    NrcCsBt|ƒ|_t|jƒ|_t|j|ƒ|_|j|kr>d}tj 	|¡‚dS)Nz.No suitable Microsoft Visual C++ version found)
r€r‘rr¨r¦Úsir­r%r&r')rr-r­Z
vc_min_verÚerrrrrr‚Ãs

zEnvironmentInfo.__init__cCs|jjS)zk
        Microsoft Visual Studio.

        Return
        ------
        float
            version
        )rïr¬)rrrrr¬Ìs
zEnvironmentInfo.vs_vercCs|jjS)zp
        Microsoft Visual C++ version.

        Return
        ------
        float
            version
        )rïr­)rrrrr­Øs
zEnvironmentInfo.vc_vercsVddg}ˆjdkrDˆjjddd}|dg7}|dg7}|d|g7}‡fd	d
„|DƒS)zu
        Microsoft Visual Studio Tools.

        Return
        ------
        list of str
            paths
        zCommon7\IDEz
Common7\Toolsg,@T)r‡rTz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}tˆjj|ƒ‘qSr)rrïrÃ)rdrR)rrrú
<listcomp>ösz+EnvironmentInfo.VSTools.<locals>.<listcomp>)r¬r‘rˆ)rÚpathsÚarch_subdirr)rrÚVSToolsäs



zEnvironmentInfo.VSToolscCst|jjdƒt|jjdƒgS)z’
        Microsoft Visual C++ & Microsoft Foundation Class Includes.

        Return
        ------
        list of str
            paths
        ÚIncludezATLMFC\Include)rrïrÇ)rrrrÚ
VCIncludesøs
zEnvironmentInfo.VCIncludescsbˆjdkrˆjjdd}nˆjjdd}d|d|g}ˆjdkrP|d|g7}‡fd	d
„|DƒS)z“
        Microsoft Visual C++ & Microsoft Foundation Class Libraries.

        Return
        ------
        list of str
            paths
        g.@T)rT)r‡zLib%szATLMFC\Lib%sg,@zLib\store%scsg|]}tˆjj|ƒ‘qSr)rrïrÇ)rdrR)rrrrñsz/EnvironmentInfo.VCLibraries.<locals>.<listcomp>)r¬r‘r‰)rróròr)rrÚVCLibrariess


zEnvironmentInfo.VCLibrariescCs|jdkrgSt|jjdƒgS)z‡
        Microsoft Visual C++ store references Libraries.

        Return
        ------
        list of str
            paths
        g,@zLib\store\references)r¬rrïrÇ)rrrrÚVCStoreRefss

zEnvironmentInfo.VCStoreRefscCs|j}t|jdƒg}|jdkr"dnd}|j |¡}|rL|t|jd|ƒg7}|jdkr|d|jjdd}|t|j|ƒg7}n€|jdkrê|j ¡r”d	nd
}|t|j||jjddƒg7}|jj	|jj
krü|t|j||jjddƒg7}n|t|jdƒg7}|S)
zr
        Microsoft Visual C++ Tools.

        Return
        ------
        list of str
            paths
        Z
VCPackagesg$@TFzBin%sg,@)r‡g.@z
bin\HostX86%sz
bin\HostX64%s)rTÚBin)rïrrÇr¬r‘rrˆr†r‰r…rƒ)rrïÚtoolsr‹rórRZhost_dirrrrÚVCTools(s&


zEnvironmentInfo.VCToolscCsh|jdkr.|jjddd}t|jjd|ƒgS|jjdd}t|jjdƒ}|j}t|d||fƒgSdS)	zw
        Microsoft Windows SDK Libraries.

        Return
        ------
        list of str
            paths
        g$@T)r‡rTzLib%s)rTrÊz%sum%sN)r¬r‘r‰rrïrÌÚ_sdk_subdir)rrórÊZlibverrrrÚOSLibrariesMs

zEnvironmentInfo.OSLibrariescCsht|jjdƒ}|jdkr&|t|dƒgS|jdkr8|j}nd}t|d|ƒt|d|ƒt|d|ƒgSd	S)
zu
        Microsoft Windows SDK Include.

        Return
        ------
        list of str
            paths
        Úincludeg$@Úglg,@rz%ssharedz%sumz%swinrtN)rrïrÌr¬rü)rrþÚsdkverrrrÚ
OSIncludesas


zEnvironmentInfo.OSIncludescCsžt|jjdƒ}g}|jdkr&||j7}|jdkr@|t|dƒg7}|jdkrš||t|jjdƒt|ddƒt|d	dƒt|d
dƒt|jjddd
|jdddƒg7}|S)z}
        Microsoft Windows SDK Libraries Paths.

        Return
        ------
        list of str
            paths
        Z
Referencesg"@g&@zCommonConfiguration\Neutralg,@Z
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ
ExtensionSDKszMicrosoft.VCLibsz%0.1fZCommonConfigurationZneutral)rrïrÌr¬rý)rÚrefÚlibpathrrrÚ	OSLibpathys*






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

        Return
        ------
        list of str
            paths
        )ÚlistÚ
_sdk_tools)rrrrÚSdkToolss
zEnvironmentInfo.SdkToolsccsø|jdkr,|jdkrdnd}t|jj|ƒV|j ¡s\|jjdd}d|}t|jj|ƒV|jdkr |j ¡rvd	}n|jjddd
}d|}t|jj|ƒVnB|jdkrât|jjdƒ}|jjdd}|jj}t|d||fƒV|jj	rô|jj	Vd
S)zˆ
        Microsoft Windows SDK Tools paths generator.

        Return
        ------
        generator of str
            paths
        g.@g&@rùzBin\x86T)rTzBin%s)g$@g&@r)r‡rTzBin\NETFX 4.0 Tools%sz%s%sN)
r¬rrïrÌr‘r†rˆr„rÍrØ)rÚbin_dirrórRrrrrr©s(	




zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)zu
        Microsoft Windows SDK version subdir.

        Return
        ------
        str
            subdir
        z%s\r)rïrÍ)rÚucrtverrrrrüÌs
zEnvironmentInfo._sdk_subdircCs|jdkrgSt|jjdƒgS)zs
        Microsoft Windows SDK Setup.

        Return
        ------
        list of str
            paths
        g"@ZSetup)r¬rrïrÌ)rrrrÚSdkSetupÙs

zEnvironmentInfo.SdkSetupcs”|j}|j‰|jdkr0d}| ¡o,| ¡}n$| ¡p>| ¡}|jdkpR|jdk}g}|rt|‡fdd„ˆjDƒ7}|r|‡fdd„ˆjDƒ7}|S)zv
        Microsoft .NET Framework Tools.

        Return
        ------
        list of str
            paths
        g$@TrWcsg|]}tˆj|ƒ‘qSr)rrà)rdr,)rïrrrñþsz+EnvironmentInfo.FxTools.<locals>.<listcomp>csg|]}tˆj|ƒ‘qSr)rrá)rdr,)rïrrrñs)	r‘rïr¬r„r†r…rƒräræ)rr‘Z	include32Z	include64rúr)rïrÚFxToolsès

zEnvironmentInfo.FxToolscCs8|jdks|jjsgS|jjdd}t|jjd|ƒgS)z~
        Microsoft .Net Framework SDK Libraries.

        Return
        ------
        list of str
            paths
        g,@T)rTzlib\um%s)r¬rïrÞr‘r‰r)rrórrrÚNetFxSDKLibrariess
z!EnvironmentInfo.NetFxSDKLibrariescCs&|jdks|jjsgSt|jjdƒgS)z}
        Microsoft .Net Framework SDK Includes.

        Return
        ------
        list of str
            paths
        g,@z
include\um)r¬rïrÞr)rrrrÚNetFxSDKIncludess
z EnvironmentInfo.NetFxSDKIncludescCst|jjdƒgS)z„
        Microsoft Visual Studio Team System Database.

        Return
        ------
        list of str
            paths
        z
VSTSDB\Deploy)rrïrÃ)rrrrÚVsTDb$s
zEnvironmentInfo.VsTDbcCsv|jdkrgS|jdkr0|jj}|jjdd}n|jj}d}d|j|f}t||ƒg}|jdkrr|t||dƒg7}|S)zn
        Microsoft Build Engine.

        Return
        ------
        list of str
            paths
        g(@g.@T)r‡rzMSBuild\%0.1f\bin%sZRoslyn)r¬rïrÁr‘rˆrÃr)rÚ	base_pathrórRÚbuildrrrÚMSBuild0s



zEnvironmentInfo.MSBuildcCs|jdkrgSt|jjdƒgS)zt
        Microsoft HTML Help Workshop.

        Return
        ------
        list of str
            paths
        g&@zHTML Help Workshop)r¬rrïrÁ)rrrrÚHTMLHelpWorkshopLs

z EnvironmentInfo.HTMLHelpWorkshopcCsD|jdkrgS|jjdd}t|jjdƒ}|j}t|d||fƒgS)zƒ
        Microsoft Universal C Runtime SDK Libraries.

        Return
        ------
        list of str
            paths
        g,@T)rTrÊz%sucrt%s)r¬r‘r‰rrïrÜÚ_ucrt_subdir)rrórÊr	rrrÚ
UCRTLibraries[s

zEnvironmentInfo.UCRTLibrariescCs.|jdkrgSt|jjdƒ}t|d|jƒgS)z
        Microsoft Universal C Runtime SDK Include.

        Return
        ------
        list of str
            paths
        g,@rþz%sucrt)r¬rrïrÜr)rrþrrrÚUCRTIncludesms

zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)z
        Microsoft Universal C Runtime SDK version subdir.

        Return
        ------
        str
            subdir
        z%s\r)rïrÝ)rr	rrrr}s
zEnvironmentInfo._ucrt_subdircCs(d|jkrdkrnngS|jjgS)zk
        Microsoft Visual F#.

        Return
        ------
        list of str
            paths
        g&@g(@)r¬rïrÙ)rrrrÚFSharpŠs
zEnvironmentInfo.FSharpc
CsÎd|j}|jjdd d¡}g}|jj}t| dd¡ƒ}t|ƒrft	|t
|ƒdƒ}||t	|dƒg7}|t	|d	ƒg7}d
|jdd
t|jƒdf}x2t
 ||¡D]"\}}t	||||ƒ}	t|	ƒr¤|	Sq¤WdS)
z
        Microsoft Visual C++ runtime redistributable dll.

        Return
        ------
        str
            path
        zvcruntime%d0.dllT)rTrŠz\Toolsz\RedistrZZonecorerXzMicrosoft.VC%d.CRTé
N)r­r‘r‰rNrïrÇrrhrrrr:r¬r6r²r)
rraróÚprefixesZ
tools_pathZredist_pathZcrt_dirsrëZcrt_dirrRrrrÚVCRuntimeRedist™s

zEnvironmentInfo.VCRuntimeRedistTcCs²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}|jdkr®t|jƒr®|j|d<|S)zÛ
        Return environment dict.

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

        Return
        ------
        dict
            environment
        rþrÊrrR)rþrÊrrRr2rm)ÚdictÚ_build_pathsrörrr
r÷rýrrrrørrûrôrrr
rrrr¬rr)rÚexistsrtrrrr*¼sD

zEnvironmentInfo.return_envc
Csntj |¡}t |d¡ t¡}t ||¡}|r<ttt	|ƒƒn|}|s\d| 
¡}tj 
|¡‚t|ƒ}	t |	¡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 %s environment variable is empty)r6ÚchainÚ
from_iterablerrJrÀrrÚfilterrÚupperr%r&r'r
r)
rr¡Zspec_path_listsrZ
spec_pathsZ	env_pathsròZextant_pathsrÆZunique_pathsrrrrîszEnvironmentInfo._build_paths)Nr)T)!rrrrŽr‚rr¬r­rôrör÷rørûrýrrrrrür
rrr
rrrrrrrrr*rrrrrr)«s:
	
%$#

#
2r))r#)r)1rŽrºÚiorÚosrrÚos.pathrrrrrwr´Úplatformr6rKÚdistutils.errorsr%Z#setuptools.extern.packaging.versionr	Z setuptools.extern.more_itertoolsr
ZmonkeyrÚsystemrrrr]r&r'Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrr$rArSr[rbrurvrzr+r€rr¦r)rrrrÚ<module>s\
*
&&'$
%s: