partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | PlatformInfo.current_dir | Current 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
------
subfolder: str
'\target... | setuptools/msvc.py | def current_dir(self, hidex86=False, x64=False):
"""
Current 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.
... | def current_dir(self, hidex86=False, x64=False):
"""
Current 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.
... | [
"Current",
"platform",
"specific",
"subfolder",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L264-L284 | [
"def",
"current_dir",
"(",
"self",
",",
"hidex86",
"=",
"False",
",",
"x64",
"=",
"False",
")",
":",
"return",
"(",
"''",
"if",
"(",
"self",
".",
"current_cpu",
"==",
"'x86'",
"and",
"hidex86",
")",
"else",
"r'\\x64'",
"if",
"(",
"self",
".",
"curren... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | PlatformInfo.target_dir | r"""
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
------
subfolder: str
... | setuptools/msvc.py | def target_dir(self, hidex86=False, x64=False):
r"""
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.
... | def target_dir(self, hidex86=False, x64=False):
r"""
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.
... | [
"r",
"Target",
"platform",
"specific",
"subfolder",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L286-L306 | [
"def",
"target_dir",
"(",
"self",
",",
"hidex86",
"=",
"False",
",",
"x64",
"=",
"False",
")",
":",
"return",
"(",
"''",
"if",
"(",
"self",
".",
"target_cpu",
"==",
"'x86'",
"and",
"hidex86",
")",
"else",
"r'\\x64'",
"if",
"(",
"self",
".",
"target_c... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | PlatformInfo.cross_dir | r"""
Cross platform specific subfolder.
Parameters
----------
forcex86: bool
Use 'x86' as current architecture even if current acritecture is
not x86.
Return
------
subfolder: str
'' if target architecture is current architect... | setuptools/msvc.py | def cross_dir(self, forcex86=False):
r"""
Cross platform specific subfolder.
Parameters
----------
forcex86: bool
Use 'x86' as current architecture even if current acritecture is
not x86.
Return
------
subfolder: str
'... | def cross_dir(self, forcex86=False):
r"""
Cross platform specific subfolder.
Parameters
----------
forcex86: bool
Use 'x86' as current architecture even if current acritecture is
not x86.
Return
------
subfolder: str
'... | [
"r",
"Cross",
"platform",
"specific",
"subfolder",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L308-L328 | [
"def",
"cross_dir",
"(",
"self",
",",
"forcex86",
"=",
"False",
")",
":",
"current",
"=",
"'x86'",
"if",
"forcex86",
"else",
"self",
".",
"current_cpu",
"return",
"(",
"''",
"if",
"self",
".",
"target_cpu",
"==",
"current",
"else",
"self",
".",
"target_d... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | RegistryInfo.microsoft | Return key in Microsoft software registry.
Parameters
----------
key: str
Registry key path where look.
x86: str
Force x86 software registry.
Return
------
str: value | setuptools/msvc.py | def microsoft(self, key, x86=False):
"""
Return key in Microsoft software registry.
Parameters
----------
key: str
Registry key path where look.
x86: str
Force x86 software registry.
Return
------
str: value
"""
... | def microsoft(self, key, x86=False):
"""
Return key in Microsoft software registry.
Parameters
----------
key: str
Registry key path where look.
x86: str
Force x86 software registry.
Return
------
str: value
"""
... | [
"Return",
"key",
"in",
"Microsoft",
"software",
"registry",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L411-L427 | [
"def",
"microsoft",
"(",
"self",
",",
"key",
",",
"x86",
"=",
"False",
")",
":",
"node64",
"=",
"''",
"if",
"self",
".",
"pi",
".",
"current_is_x86",
"(",
")",
"or",
"x86",
"else",
"'Wow6432Node'",
"return",
"os",
".",
"path",
".",
"join",
"(",
"'S... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | RegistryInfo.lookup | 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 | setuptools/msvc.py | def lookup(self, key, name):
"""
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
"""
... | def lookup(self, key, name):
"""
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
"""
... | [
"Look",
"for",
"values",
"in",
"registry",
"in",
"Microsoft",
"software",
"registry",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L429-L461 | [
"def",
"lookup",
"(",
"self",
",",
"key",
",",
"name",
")",
":",
"KEY_READ",
"=",
"winreg",
".",
"KEY_READ",
"openkey",
"=",
"winreg",
".",
"OpenKey",
"ms",
"=",
"self",
".",
"microsoft",
"for",
"hkey",
"in",
"self",
".",
"HKEYS",
":",
"try",
":",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.find_available_vc_vers | Find all available Microsoft Visual C++ versions. | setuptools/msvc.py | def find_available_vc_vers(self):
"""
Find all available Microsoft Visual C++ versions.
"""
ms = self.ri.microsoft
vckeys = (self.ri.vc, self.ri.vc_for_python, self.ri.vs)
vc_vers = []
for hkey in self.ri.HKEYS:
for key in vckeys:
try:
... | def find_available_vc_vers(self):
"""
Find all available Microsoft Visual C++ versions.
"""
ms = self.ri.microsoft
vckeys = (self.ri.vc, self.ri.vc_for_python, self.ri.vs)
vc_vers = []
for hkey in self.ri.HKEYS:
for key in vckeys:
try:
... | [
"Find",
"all",
"available",
"Microsoft",
"Visual",
"C",
"++",
"versions",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L494-L522 | [
"def",
"find_available_vc_vers",
"(",
"self",
")",
":",
"ms",
"=",
"self",
".",
"ri",
".",
"microsoft",
"vckeys",
"=",
"(",
"self",
".",
"ri",
".",
"vc",
",",
"self",
".",
"ri",
".",
"vc_for_python",
",",
"self",
".",
"ri",
".",
"vs",
")",
"vc_vers... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.VSInstallDir | Microsoft Visual Studio directory. | setuptools/msvc.py | def VSInstallDir(self):
"""
Microsoft Visual Studio directory.
"""
# Default path
name = 'Microsoft Visual Studio %0.1f' % self.vc_ver
default = os.path.join(self.ProgramFilesx86, name)
# Try to get path from registry, if fail use default path
return self... | def VSInstallDir(self):
"""
Microsoft Visual Studio directory.
"""
# Default path
name = 'Microsoft Visual Studio %0.1f' % self.vc_ver
default = os.path.join(self.ProgramFilesx86, name)
# Try to get path from registry, if fail use default path
return self... | [
"Microsoft",
"Visual",
"Studio",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L525-L534 | [
"def",
"VSInstallDir",
"(",
"self",
")",
":",
"# Default path",
"name",
"=",
"'Microsoft Visual Studio %0.1f'",
"%",
"self",
".",
"vc_ver",
"default",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ProgramFilesx86",
",",
"name",
")",
"# Try to get pat... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.VCInstallDir | Microsoft Visual C++ directory. | setuptools/msvc.py | def VCInstallDir(self):
"""
Microsoft Visual C++ directory.
"""
self.VSInstallDir
guess_vc = self._guess_vc() or self._guess_vc_legacy()
# Try to get "VC++ for Python" path from registry as default path
reg_path = os.path.join(self.ri.vc_for_python, '%0.1f' % se... | def VCInstallDir(self):
"""
Microsoft Visual C++ directory.
"""
self.VSInstallDir
guess_vc = self._guess_vc() or self._guess_vc_legacy()
# Try to get "VC++ for Python" path from registry as default path
reg_path = os.path.join(self.ri.vc_for_python, '%0.1f' % se... | [
"Microsoft",
"Visual",
"C",
"++",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L537-L557 | [
"def",
"VCInstallDir",
"(",
"self",
")",
":",
"self",
".",
"VSInstallDir",
"guess_vc",
"=",
"self",
".",
"_guess_vc",
"(",
")",
"or",
"self",
".",
"_guess_vc_legacy",
"(",
")",
"# Try to get \"VC++ for Python\" path from registry as default path",
"reg_path",
"=",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo._guess_vc | Locate Visual C for 2017 | setuptools/msvc.py | def _guess_vc(self):
"""
Locate Visual C for 2017
"""
if self.vc_ver <= 14.0:
return
default = r'VC\Tools\MSVC'
guess_vc = os.path.join(self.VSInstallDir, default)
# Subdir with VC exact version as name
try:
vc_exact_ver = os.listd... | def _guess_vc(self):
"""
Locate Visual C for 2017
"""
if self.vc_ver <= 14.0:
return
default = r'VC\Tools\MSVC'
guess_vc = os.path.join(self.VSInstallDir, default)
# Subdir with VC exact version as name
try:
vc_exact_ver = os.listd... | [
"Locate",
"Visual",
"C",
"for",
"2017"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L559-L573 | [
"def",
"_guess_vc",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<=",
"14.0",
":",
"return",
"default",
"=",
"r'VC\\Tools\\MSVC'",
"guess_vc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"VSInstallDir",
",",
"default",
")",
"# Subdir w... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo._guess_vc_legacy | Locate Visual C for versions prior to 2017 | setuptools/msvc.py | def _guess_vc_legacy(self):
"""
Locate Visual C for versions prior to 2017
"""
default = r'Microsoft Visual Studio %0.1f\VC' % self.vc_ver
return os.path.join(self.ProgramFilesx86, default) | def _guess_vc_legacy(self):
"""
Locate Visual C for versions prior to 2017
"""
default = r'Microsoft Visual Studio %0.1f\VC' % self.vc_ver
return os.path.join(self.ProgramFilesx86, default) | [
"Locate",
"Visual",
"C",
"for",
"versions",
"prior",
"to",
"2017"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L575-L580 | [
"def",
"_guess_vc_legacy",
"(",
"self",
")",
":",
"default",
"=",
"r'Microsoft Visual Studio %0.1f\\VC'",
"%",
"self",
".",
"vc_ver",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ProgramFilesx86",
",",
"default",
")"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.WindowsSdkVersion | Microsoft Windows SDK versions for specified MSVC++ version. | setuptools/msvc.py | def WindowsSdkVersion(self):
"""
Microsoft Windows SDK versions for specified MSVC++ version.
"""
if self.vc_ver <= 9.0:
return ('7.0', '6.1', '6.0a')
elif self.vc_ver == 10.0:
return ('7.1', '7.0a')
elif self.vc_ver == 11.0:
return ('8... | def WindowsSdkVersion(self):
"""
Microsoft Windows SDK versions for specified MSVC++ version.
"""
if self.vc_ver <= 9.0:
return ('7.0', '6.1', '6.0a')
elif self.vc_ver == 10.0:
return ('7.1', '7.0a')
elif self.vc_ver == 11.0:
return ('8... | [
"Microsoft",
"Windows",
"SDK",
"versions",
"for",
"specified",
"MSVC",
"++",
"version",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L583-L596 | [
"def",
"WindowsSdkVersion",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<=",
"9.0",
":",
"return",
"(",
"'7.0'",
",",
"'6.1'",
",",
"'6.0a'",
")",
"elif",
"self",
".",
"vc_ver",
"==",
"10.0",
":",
"return",
"(",
"'7.1'",
",",
"'7.0a'",
")",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.WindowsSdkDir | Microsoft Windows SDK directory. | setuptools/msvc.py | def WindowsSdkDir(self):
"""
Microsoft Windows SDK directory.
"""
sdkdir = ''
for ver in self.WindowsSdkVersion:
# Try to get it from registry
loc = os.path.join(self.ri.windows_sdk, 'v%s' % ver)
sdkdir = self.ri.lookup(loc, 'installationfolder... | def WindowsSdkDir(self):
"""
Microsoft Windows SDK directory.
"""
sdkdir = ''
for ver in self.WindowsSdkVersion:
# Try to get it from registry
loc = os.path.join(self.ri.windows_sdk, 'v%s' % ver)
sdkdir = self.ri.lookup(loc, 'installationfolder... | [
"Microsoft",
"Windows",
"SDK",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L607-L642 | [
"def",
"WindowsSdkDir",
"(",
"self",
")",
":",
"sdkdir",
"=",
"''",
"for",
"ver",
"in",
"self",
".",
"WindowsSdkVersion",
":",
"# Try to get it from registry",
"loc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ri",
".",
"windows_sdk",
",",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.WindowsSDKExecutablePath | Microsoft Windows SDK executable directory. | setuptools/msvc.py | def WindowsSDKExecutablePath(self):
"""
Microsoft Windows SDK executable directory.
"""
# Find WinSDK NetFx Tools registry dir name
if self.vc_ver <= 11.0:
netfxver = 35
arch = ''
else:
netfxver = 40
hidex86 = True if self.v... | def WindowsSDKExecutablePath(self):
"""
Microsoft Windows SDK executable directory.
"""
# Find WinSDK NetFx Tools registry dir name
if self.vc_ver <= 11.0:
netfxver = 35
arch = ''
else:
netfxver = 40
hidex86 = True if self.v... | [
"Microsoft",
"Windows",
"SDK",
"executable",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L645-L673 | [
"def",
"WindowsSDKExecutablePath",
"(",
"self",
")",
":",
"# Find WinSDK NetFx Tools registry dir name",
"if",
"self",
".",
"vc_ver",
"<=",
"11.0",
":",
"netfxver",
"=",
"35",
"arch",
"=",
"''",
"else",
":",
"netfxver",
"=",
"40",
"hidex86",
"=",
"True",
"if",... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.FSharpInstallDir | Microsoft Visual F# directory. | setuptools/msvc.py | def FSharpInstallDir(self):
"""
Microsoft Visual F# directory.
"""
path = r'%0.1f\Setup\F#' % self.vc_ver
path = os.path.join(self.ri.visualstudio, path)
return self.ri.lookup(path, 'productdir') or '' | def FSharpInstallDir(self):
"""
Microsoft Visual F# directory.
"""
path = r'%0.1f\Setup\F#' % self.vc_ver
path = os.path.join(self.ri.visualstudio, path)
return self.ri.lookup(path, 'productdir') or '' | [
"Microsoft",
"Visual",
"F#",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L676-L682 | [
"def",
"FSharpInstallDir",
"(",
"self",
")",
":",
"path",
"=",
"r'%0.1f\\Setup\\F#'",
"%",
"self",
".",
"vc_ver",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ri",
".",
"visualstudio",
",",
"path",
")",
"return",
"self",
".",
"ri",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.UniversalCRTSdkDir | Microsoft Universal CRT SDK directory. | setuptools/msvc.py | def UniversalCRTSdkDir(self):
"""
Microsoft Universal CRT SDK directory.
"""
# Set Kit Roots versions for specified MSVC++ version
if self.vc_ver >= 14.0:
vers = ('10', '81')
else:
vers = ()
# Find path of the more recent Kit
for v... | def UniversalCRTSdkDir(self):
"""
Microsoft Universal CRT SDK directory.
"""
# Set Kit Roots versions for specified MSVC++ version
if self.vc_ver >= 14.0:
vers = ('10', '81')
else:
vers = ()
# Find path of the more recent Kit
for v... | [
"Microsoft",
"Universal",
"CRT",
"SDK",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L685-L701 | [
"def",
"UniversalCRTSdkDir",
"(",
"self",
")",
":",
"# Set Kit Roots versions for specified MSVC++ version",
"if",
"self",
".",
"vc_ver",
">=",
"14.0",
":",
"vers",
"=",
"(",
"'10'",
",",
"'81'",
")",
"else",
":",
"vers",
"=",
"(",
")",
"# Find path of the more ... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.NetFxSdkDir | Microsoft .NET Framework SDK directory. | setuptools/msvc.py | def NetFxSdkDir(self):
"""
Microsoft .NET Framework SDK directory.
"""
for ver in self.NetFxSdkVersion:
loc = os.path.join(self.ri.netfx_sdk, ver)
sdkdir = self.ri.lookup(loc, 'kitsinstallationfolder')
if sdkdir:
break
return sd... | def NetFxSdkDir(self):
"""
Microsoft .NET Framework SDK directory.
"""
for ver in self.NetFxSdkVersion:
loc = os.path.join(self.ri.netfx_sdk, ver)
sdkdir = self.ri.lookup(loc, 'kitsinstallationfolder')
if sdkdir:
break
return sd... | [
"Microsoft",
".",
"NET",
"Framework",
"SDK",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L723-L732 | [
"def",
"NetFxSdkDir",
"(",
"self",
")",
":",
"for",
"ver",
"in",
"self",
".",
"NetFxSdkVersion",
":",
"loc",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ri",
".",
"netfx_sdk",
",",
"ver",
")",
"sdkdir",
"=",
"self",
".",
"ri",
".",
"l... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.FrameworkDir32 | Microsoft .NET Framework 32bit directory. | setuptools/msvc.py | def FrameworkDir32(self):
"""
Microsoft .NET Framework 32bit directory.
"""
# Default path
guess_fw = os.path.join(self.WinDir, r'Microsoft.NET\Framework')
# Try to get path from registry, if fail use default path
return self.ri.lookup(self.ri.vc, 'frameworkdir32... | def FrameworkDir32(self):
"""
Microsoft .NET Framework 32bit directory.
"""
# Default path
guess_fw = os.path.join(self.WinDir, r'Microsoft.NET\Framework')
# Try to get path from registry, if fail use default path
return self.ri.lookup(self.ri.vc, 'frameworkdir32... | [
"Microsoft",
".",
"NET",
"Framework",
"32bit",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L735-L743 | [
"def",
"FrameworkDir32",
"(",
"self",
")",
":",
"# Default path",
"guess_fw",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"WinDir",
",",
"r'Microsoft.NET\\Framework'",
")",
"# Try to get path from registry, if fail use default path",
"return",
"self",
".",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo.FrameworkDir64 | Microsoft .NET Framework 64bit directory. | setuptools/msvc.py | def FrameworkDir64(self):
"""
Microsoft .NET Framework 64bit directory.
"""
# Default path
guess_fw = os.path.join(self.WinDir, r'Microsoft.NET\Framework64')
# Try to get path from registry, if fail use default path
return self.ri.lookup(self.ri.vc, 'frameworkdir... | def FrameworkDir64(self):
"""
Microsoft .NET Framework 64bit directory.
"""
# Default path
guess_fw = os.path.join(self.WinDir, r'Microsoft.NET\Framework64')
# Try to get path from registry, if fail use default path
return self.ri.lookup(self.ri.vc, 'frameworkdir... | [
"Microsoft",
".",
"NET",
"Framework",
"64bit",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L746-L754 | [
"def",
"FrameworkDir64",
"(",
"self",
")",
":",
"# Default path",
"guess_fw",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"WinDir",
",",
"r'Microsoft.NET\\Framework64'",
")",
"# Try to get path from registry, if fail use default path",
"return",
"self",
"."... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo._find_dot_net_versions | Find Microsoft .NET Framework versions.
Parameters
----------
bits: int
Platform number of bits: 32 or 64. | setuptools/msvc.py | def _find_dot_net_versions(self, bits):
"""
Find Microsoft .NET Framework versions.
Parameters
----------
bits: int
Platform number of bits: 32 or 64.
"""
# Find actual .NET version in registry
reg_ver = self.ri.lookup(self.ri.vc, 'frameworkve... | def _find_dot_net_versions(self, bits):
"""
Find Microsoft .NET Framework versions.
Parameters
----------
bits: int
Platform number of bits: 32 or 64.
"""
# Find actual .NET version in registry
reg_ver = self.ri.lookup(self.ri.vc, 'frameworkve... | [
"Find",
"Microsoft",
".",
"NET",
"Framework",
"versions",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L770-L794 | [
"def",
"_find_dot_net_versions",
"(",
"self",
",",
"bits",
")",
":",
"# Find actual .NET version in registry",
"reg_ver",
"=",
"self",
".",
"ri",
".",
"lookup",
"(",
"self",
".",
"ri",
".",
"vc",
",",
"'frameworkver%d'",
"%",
"bits",
")",
"dot_net_dir",
"=",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | SystemInfo._use_last_dir_name | 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 startings by this prefix | setuptools/msvc.py | def _use_last_dir_name(self, path, prefix=''):
"""
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 startings by this prefix
"""
matching_dir... | def _use_last_dir_name(self, path, prefix=''):
"""
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 startings by this prefix
"""
matching_dir... | [
"Return",
"name",
"of",
"the",
"last",
"dir",
"in",
"path",
"or",
"if",
"no",
"dir",
"found",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L796-L813 | [
"def",
"_use_last_dir_name",
"(",
"self",
",",
"path",
",",
"prefix",
"=",
"''",
")",
":",
"matching_dirs",
"=",
"(",
"dir_name",
"for",
"dir_name",
"in",
"reversed",
"(",
"os",
".",
"listdir",
"(",
"path",
")",
")",
"if",
"os",
".",
"path",
".",
"is... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.VSTools | Microsoft Visual Studio Tools | setuptools/msvc.py | def VSTools(self):
"""
Microsoft Visual Studio Tools
"""
paths = [r'Common7\IDE', r'Common7\Tools']
if self.vc_ver >= 14.0:
arch_subdir = self.pi.current_dir(hidex86=True, x64=True)
paths += [r'Common7\IDE\CommonExtensions\Microsoft\TestWindow']
... | def VSTools(self):
"""
Microsoft Visual Studio Tools
"""
paths = [r'Common7\IDE', r'Common7\Tools']
if self.vc_ver >= 14.0:
arch_subdir = self.pi.current_dir(hidex86=True, x64=True)
paths += [r'Common7\IDE\CommonExtensions\Microsoft\TestWindow']
... | [
"Microsoft",
"Visual",
"Studio",
"Tools"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L857-L869 | [
"def",
"VSTools",
"(",
"self",
")",
":",
"paths",
"=",
"[",
"r'Common7\\IDE'",
",",
"r'Common7\\Tools'",
"]",
"if",
"self",
".",
"vc_ver",
">=",
"14.0",
":",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"current_dir",
"(",
"hidex86",
"=",
"True",
",",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.VCIncludes | Microsoft Visual C++ & Microsoft Foundation Class Includes | setuptools/msvc.py | def VCIncludes(self):
"""
Microsoft Visual C++ & Microsoft Foundation Class Includes
"""
return [os.path.join(self.si.VCInstallDir, 'Include'),
os.path.join(self.si.VCInstallDir, r'ATLMFC\Include')] | def VCIncludes(self):
"""
Microsoft Visual C++ & Microsoft Foundation Class Includes
"""
return [os.path.join(self.si.VCInstallDir, 'Include'),
os.path.join(self.si.VCInstallDir, r'ATLMFC\Include')] | [
"Microsoft",
"Visual",
"C",
"++",
"&",
"Microsoft",
"Foundation",
"Class",
"Includes"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L872-L877 | [
"def",
"VCIncludes",
"(",
"self",
")",
":",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"VCInstallDir",
",",
"'Include'",
")",
",",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"VCInstallDir",
",",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.VCLibraries | Microsoft Visual C++ & Microsoft Foundation Class Libraries | setuptools/msvc.py | def VCLibraries(self):
"""
Microsoft Visual C++ & Microsoft Foundation Class Libraries
"""
if self.vc_ver >= 15.0:
arch_subdir = self.pi.target_dir(x64=True)
else:
arch_subdir = self.pi.target_dir(hidex86=True)
paths = ['Lib%s' % arch_subdir, r'ATL... | def VCLibraries(self):
"""
Microsoft Visual C++ & Microsoft Foundation Class Libraries
"""
if self.vc_ver >= 15.0:
arch_subdir = self.pi.target_dir(x64=True)
else:
arch_subdir = self.pi.target_dir(hidex86=True)
paths = ['Lib%s' % arch_subdir, r'ATL... | [
"Microsoft",
"Visual",
"C",
"++",
"&",
"Microsoft",
"Foundation",
"Class",
"Libraries"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L880-L893 | [
"def",
"VCLibraries",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
">=",
"15.0",
":",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"target_dir",
"(",
"x64",
"=",
"True",
")",
"else",
":",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"target_dir"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.VCStoreRefs | Microsoft Visual C++ store references Libraries | setuptools/msvc.py | def VCStoreRefs(self):
"""
Microsoft Visual C++ store references Libraries
"""
if self.vc_ver < 14.0:
return []
return [os.path.join(self.si.VCInstallDir, r'Lib\store\references')] | def VCStoreRefs(self):
"""
Microsoft Visual C++ store references Libraries
"""
if self.vc_ver < 14.0:
return []
return [os.path.join(self.si.VCInstallDir, r'Lib\store\references')] | [
"Microsoft",
"Visual",
"C",
"++",
"store",
"references",
"Libraries"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L896-L902 | [
"def",
"VCStoreRefs",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"14.0",
":",
"return",
"[",
"]",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"VCInstallDir",
",",
"r'Lib\\store\\references'",
")",
"]"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.VCTools | Microsoft Visual C++ Tools | setuptools/msvc.py | def VCTools(self):
"""
Microsoft Visual C++ Tools
"""
si = self.si
tools = [os.path.join(si.VCInstallDir, 'VCPackages')]
forcex86 = True if self.vc_ver <= 10.0 else False
arch_subdir = self.pi.cross_dir(forcex86)
if arch_subdir:
tools += [os.p... | def VCTools(self):
"""
Microsoft Visual C++ Tools
"""
si = self.si
tools = [os.path.join(si.VCInstallDir, 'VCPackages')]
forcex86 = True if self.vc_ver <= 10.0 else False
arch_subdir = self.pi.cross_dir(forcex86)
if arch_subdir:
tools += [os.p... | [
"Microsoft",
"Visual",
"C",
"++",
"Tools"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L905-L934 | [
"def",
"VCTools",
"(",
"self",
")",
":",
"si",
"=",
"self",
".",
"si",
"tools",
"=",
"[",
"os",
".",
"path",
".",
"join",
"(",
"si",
".",
"VCInstallDir",
",",
"'VCPackages'",
")",
"]",
"forcex86",
"=",
"True",
"if",
"self",
".",
"vc_ver",
"<=",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.OSLibraries | Microsoft Windows SDK Libraries | setuptools/msvc.py | def OSLibraries(self):
"""
Microsoft Windows SDK Libraries
"""
if self.vc_ver <= 10.0:
arch_subdir = self.pi.target_dir(hidex86=True, x64=True)
return [os.path.join(self.si.WindowsSdkDir, 'Lib%s' % arch_subdir)]
else:
arch_subdir = self.pi.tar... | def OSLibraries(self):
"""
Microsoft Windows SDK Libraries
"""
if self.vc_ver <= 10.0:
arch_subdir = self.pi.target_dir(hidex86=True, x64=True)
return [os.path.join(self.si.WindowsSdkDir, 'Lib%s' % arch_subdir)]
else:
arch_subdir = self.pi.tar... | [
"Microsoft",
"Windows",
"SDK",
"Libraries"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L937-L949 | [
"def",
"OSLibraries",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<=",
"10.0",
":",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"target_dir",
"(",
"hidex86",
"=",
"True",
",",
"x64",
"=",
"True",
")",
"return",
"[",
"os",
".",
"path",
".",... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.OSIncludes | Microsoft Windows SDK Include | setuptools/msvc.py | def OSIncludes(self):
"""
Microsoft Windows SDK Include
"""
include = os.path.join(self.si.WindowsSdkDir, 'include')
if self.vc_ver <= 10.0:
return [include, os.path.join(include, 'gl')]
else:
if self.vc_ver >= 14.0:
sdkver = self... | def OSIncludes(self):
"""
Microsoft Windows SDK Include
"""
include = os.path.join(self.si.WindowsSdkDir, 'include')
if self.vc_ver <= 10.0:
return [include, os.path.join(include, 'gl')]
else:
if self.vc_ver >= 14.0:
sdkver = self... | [
"Microsoft",
"Windows",
"SDK",
"Include"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L952-L968 | [
"def",
"OSIncludes",
"(",
"self",
")",
":",
"include",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"WindowsSdkDir",
",",
"'include'",
")",
"if",
"self",
".",
"vc_ver",
"<=",
"10.0",
":",
"return",
"[",
"include",
",",
"os",
".... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.OSLibpath | Microsoft Windows SDK Libraries Paths | setuptools/msvc.py | def OSLibpath(self):
"""
Microsoft Windows SDK Libraries Paths
"""
ref = os.path.join(self.si.WindowsSdkDir, 'References')
libpath = []
if self.vc_ver <= 9.0:
libpath += self.OSLibraries
if self.vc_ver >= 11.0:
libpath += [os.path.join(re... | def OSLibpath(self):
"""
Microsoft Windows SDK Libraries Paths
"""
ref = os.path.join(self.si.WindowsSdkDir, 'References')
libpath = []
if self.vc_ver <= 9.0:
libpath += self.OSLibraries
if self.vc_ver >= 11.0:
libpath += [os.path.join(re... | [
"Microsoft",
"Windows",
"SDK",
"Libraries",
"Paths"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L971-L1013 | [
"def",
"OSLibpath",
"(",
"self",
")",
":",
"ref",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"WindowsSdkDir",
",",
"'References'",
")",
"libpath",
"=",
"[",
"]",
"if",
"self",
".",
"vc_ver",
"<=",
"9.0",
":",
"libpath",
"+=",... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo._sdk_tools | Microsoft Windows SDK Tools paths generator | setuptools/msvc.py | def _sdk_tools(self):
"""
Microsoft Windows SDK Tools paths generator
"""
if self.vc_ver < 15.0:
bin_dir = 'Bin' if self.vc_ver <= 11.0 else r'Bin\x86'
yield os.path.join(self.si.WindowsSdkDir, bin_dir)
if not self.pi.current_is_x86():
arch_su... | def _sdk_tools(self):
"""
Microsoft Windows SDK Tools paths generator
"""
if self.vc_ver < 15.0:
bin_dir = 'Bin' if self.vc_ver <= 11.0 else r'Bin\x86'
yield os.path.join(self.si.WindowsSdkDir, bin_dir)
if not self.pi.current_is_x86():
arch_su... | [
"Microsoft",
"Windows",
"SDK",
"Tools",
"paths",
"generator"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1022-L1050 | [
"def",
"_sdk_tools",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"15.0",
":",
"bin_dir",
"=",
"'Bin'",
"if",
"self",
".",
"vc_ver",
"<=",
"11.0",
"else",
"r'Bin\\x86'",
"yield",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.SdkSetup | Microsoft Windows SDK Setup | setuptools/msvc.py | def SdkSetup(self):
"""
Microsoft Windows SDK Setup
"""
if self.vc_ver > 9.0:
return []
return [os.path.join(self.si.WindowsSdkDir, 'Setup')] | def SdkSetup(self):
"""
Microsoft Windows SDK Setup
"""
if self.vc_ver > 9.0:
return []
return [os.path.join(self.si.WindowsSdkDir, 'Setup')] | [
"Microsoft",
"Windows",
"SDK",
"Setup"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1061-L1068 | [
"def",
"SdkSetup",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
">",
"9.0",
":",
"return",
"[",
"]",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"WindowsSdkDir",
",",
"'Setup'",
")",
"]"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.FxTools | Microsoft .NET Framework Tools | setuptools/msvc.py | def FxTools(self):
"""
Microsoft .NET Framework Tools
"""
pi = self.pi
si = self.si
if self.vc_ver <= 10.0:
include32 = True
include64 = not pi.target_is_x86() and not pi.current_is_x86()
else:
include32 = pi.target_is_x86() or... | def FxTools(self):
"""
Microsoft .NET Framework Tools
"""
pi = self.pi
si = self.si
if self.vc_ver <= 10.0:
include32 = True
include64 = not pi.target_is_x86() and not pi.current_is_x86()
else:
include32 = pi.target_is_x86() or... | [
"Microsoft",
".",
"NET",
"Framework",
"Tools"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1071-L1092 | [
"def",
"FxTools",
"(",
"self",
")",
":",
"pi",
"=",
"self",
".",
"pi",
"si",
"=",
"self",
".",
"si",
"if",
"self",
".",
"vc_ver",
"<=",
"10.0",
":",
"include32",
"=",
"True",
"include64",
"=",
"not",
"pi",
".",
"target_is_x86",
"(",
")",
"and",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.NetFxSDKLibraries | Microsoft .Net Framework SDK Libraries | setuptools/msvc.py | def NetFxSDKLibraries(self):
"""
Microsoft .Net Framework SDK Libraries
"""
if self.vc_ver < 14.0 or not self.si.NetFxSdkDir:
return []
arch_subdir = self.pi.target_dir(x64=True)
return [os.path.join(self.si.NetFxSdkDir, r'lib\um%s' % arch_subdir)] | def NetFxSDKLibraries(self):
"""
Microsoft .Net Framework SDK Libraries
"""
if self.vc_ver < 14.0 or not self.si.NetFxSdkDir:
return []
arch_subdir = self.pi.target_dir(x64=True)
return [os.path.join(self.si.NetFxSdkDir, r'lib\um%s' % arch_subdir)] | [
"Microsoft",
".",
"Net",
"Framework",
"SDK",
"Libraries"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1095-L1103 | [
"def",
"NetFxSDKLibraries",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"14.0",
"or",
"not",
"self",
".",
"si",
".",
"NetFxSdkDir",
":",
"return",
"[",
"]",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"target_dir",
"(",
"x64",
"=",
"True... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.NetFxSDKIncludes | Microsoft .Net Framework SDK Includes | setuptools/msvc.py | def NetFxSDKIncludes(self):
"""
Microsoft .Net Framework SDK Includes
"""
if self.vc_ver < 14.0 or not self.si.NetFxSdkDir:
return []
return [os.path.join(self.si.NetFxSdkDir, r'include\um')] | def NetFxSDKIncludes(self):
"""
Microsoft .Net Framework SDK Includes
"""
if self.vc_ver < 14.0 or not self.si.NetFxSdkDir:
return []
return [os.path.join(self.si.NetFxSdkDir, r'include\um')] | [
"Microsoft",
".",
"Net",
"Framework",
"SDK",
"Includes"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1106-L1113 | [
"def",
"NetFxSDKIncludes",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"14.0",
"or",
"not",
"self",
".",
"si",
".",
"NetFxSdkDir",
":",
"return",
"[",
"]",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.MSBuild | Microsoft Build Engine | setuptools/msvc.py | def MSBuild(self):
"""
Microsoft Build Engine
"""
if self.vc_ver < 12.0:
return []
elif self.vc_ver < 15.0:
base_path = self.si.ProgramFilesx86
arch_subdir = self.pi.current_dir(hidex86=True)
else:
base_path = self.si.VSInst... | def MSBuild(self):
"""
Microsoft Build Engine
"""
if self.vc_ver < 12.0:
return []
elif self.vc_ver < 15.0:
base_path = self.si.ProgramFilesx86
arch_subdir = self.pi.current_dir(hidex86=True)
else:
base_path = self.si.VSInst... | [
"Microsoft",
"Build",
"Engine"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1123-L1143 | [
"def",
"MSBuild",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"12.0",
":",
"return",
"[",
"]",
"elif",
"self",
".",
"vc_ver",
"<",
"15.0",
":",
"base_path",
"=",
"self",
".",
"si",
".",
"ProgramFilesx86",
"arch_subdir",
"=",
"self",
".",... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.HTMLHelpWorkshop | Microsoft HTML Help Workshop | setuptools/msvc.py | def HTMLHelpWorkshop(self):
"""
Microsoft HTML Help Workshop
"""
if self.vc_ver < 11.0:
return []
return [os.path.join(self.si.ProgramFilesx86, 'HTML Help Workshop')] | def HTMLHelpWorkshop(self):
"""
Microsoft HTML Help Workshop
"""
if self.vc_ver < 11.0:
return []
return [os.path.join(self.si.ProgramFilesx86, 'HTML Help Workshop')] | [
"Microsoft",
"HTML",
"Help",
"Workshop"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1146-L1153 | [
"def",
"HTMLHelpWorkshop",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"11.0",
":",
"return",
"[",
"]",
"return",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"ProgramFilesx86",
",",
"'HTML Help Workshop'",
")",
"]"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.UCRTLibraries | Microsoft Universal C Runtime SDK Libraries | setuptools/msvc.py | def UCRTLibraries(self):
"""
Microsoft Universal C Runtime SDK Libraries
"""
if self.vc_ver < 14.0:
return []
arch_subdir = self.pi.target_dir(x64=True)
lib = os.path.join(self.si.UniversalCRTSdkDir, 'lib')
ucrtver = self._ucrt_subdir
return [... | def UCRTLibraries(self):
"""
Microsoft Universal C Runtime SDK Libraries
"""
if self.vc_ver < 14.0:
return []
arch_subdir = self.pi.target_dir(x64=True)
lib = os.path.join(self.si.UniversalCRTSdkDir, 'lib')
ucrtver = self._ucrt_subdir
return [... | [
"Microsoft",
"Universal",
"C",
"Runtime",
"SDK",
"Libraries"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1156-L1166 | [
"def",
"UCRTLibraries",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"14.0",
":",
"return",
"[",
"]",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"target_dir",
"(",
"x64",
"=",
"True",
")",
"lib",
"=",
"os",
".",
"path",
".",
"join",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.UCRTIncludes | Microsoft Universal C Runtime SDK Include | setuptools/msvc.py | def UCRTIncludes(self):
"""
Microsoft Universal C Runtime SDK Include
"""
if self.vc_ver < 14.0:
return []
include = os.path.join(self.si.UniversalCRTSdkDir, 'include')
return [os.path.join(include, '%sucrt' % self._ucrt_subdir)] | def UCRTIncludes(self):
"""
Microsoft Universal C Runtime SDK Include
"""
if self.vc_ver < 14.0:
return []
include = os.path.join(self.si.UniversalCRTSdkDir, 'include')
return [os.path.join(include, '%sucrt' % self._ucrt_subdir)] | [
"Microsoft",
"Universal",
"C",
"Runtime",
"SDK",
"Include"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1169-L1177 | [
"def",
"UCRTIncludes",
"(",
"self",
")",
":",
"if",
"self",
".",
"vc_ver",
"<",
"14.0",
":",
"return",
"[",
"]",
"include",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"si",
".",
"UniversalCRTSdkDir",
",",
"'include'",
")",
"return",
"[",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.VCRuntimeRedist | Microsoft Visual C++ runtime redistribuable dll | setuptools/msvc.py | def VCRuntimeRedist(self):
"""
Microsoft Visual C++ runtime redistribuable dll
"""
arch_subdir = self.pi.target_dir(x64=True)
if self.vc_ver < 15:
redist_path = self.si.VCInstallDir
vcruntime = 'redist%s\\Microsoft.VC%d0.CRT\\vcruntime%d0.dll'
else... | def VCRuntimeRedist(self):
"""
Microsoft Visual C++ runtime redistribuable dll
"""
arch_subdir = self.pi.target_dir(x64=True)
if self.vc_ver < 15:
redist_path = self.si.VCInstallDir
vcruntime = 'redist%s\\Microsoft.VC%d0.CRT\\vcruntime%d0.dll'
else... | [
"Microsoft",
"Visual",
"C",
"++",
"runtime",
"redistribuable",
"dll"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1198-L1214 | [
"def",
"VCRuntimeRedist",
"(",
"self",
")",
":",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"target_dir",
"(",
"x64",
"=",
"True",
")",
"if",
"self",
".",
"vc_ver",
"<",
"15",
":",
"redist_path",
"=",
"self",
".",
"si",
".",
"VCInstallDir",
"vcruntime... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo.return_env | Return environment dict.
Parameters
----------
exists: bool
It True, only return existing paths. | setuptools/msvc.py | def return_env(self, exists=True):
"""
Return environment dict.
Parameters
----------
exists: bool
It True, only return existing paths.
"""
env = dict(
include=self._build_paths('include',
[self.VCIncl... | def return_env(self, exists=True):
"""
Return environment dict.
Parameters
----------
exists: bool
It True, only return existing paths.
"""
env = dict(
include=self._build_paths('include',
[self.VCIncl... | [
"Return",
"environment",
"dict",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1216-L1259 | [
"def",
"return_env",
"(",
"self",
",",
"exists",
"=",
"True",
")",
":",
"env",
"=",
"dict",
"(",
"include",
"=",
"self",
".",
"_build_paths",
"(",
"'include'",
",",
"[",
"self",
".",
"VCIncludes",
",",
"self",
".",
"OSIncludes",
",",
"self",
".",
"UC... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | EnvironmentInfo._build_paths | 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. | setuptools/msvc.py | def _build_paths(self, name, spec_path_lists, exists):
"""
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
... | def _build_paths(self, name, spec_path_lists, exists):
"""
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
... | [
"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",
"v... | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/msvc.py#L1261-L1278 | [
"def",
"_build_paths",
"(",
"self",
",",
"name",
",",
"spec_path_lists",
",",
"exists",
")",
":",
"# flatten spec_path_lists",
"spec_paths",
"=",
"itertools",
".",
"chain",
".",
"from_iterable",
"(",
"spec_path_lists",
")",
"env_paths",
"=",
"safe_env",
".",
"ge... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | get_abi3_suffix | Return the file extension for an abi3-compliant Extension() | setuptools/command/build_ext.py | def get_abi3_suffix():
"""Return the file extension for an abi3-compliant Extension()"""
for suffix, _, _ in (s for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION):
if '.abi3' in suffix: # Unix
return suffix
elif suffix == '.pyd': # Windows
return suffix | def get_abi3_suffix():
"""Return the file extension for an abi3-compliant Extension()"""
for suffix, _, _ in (s for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION):
if '.abi3' in suffix: # Unix
return suffix
elif suffix == '.pyd': # Windows
return suffix | [
"Return",
"the",
"file",
"extension",
"for",
"an",
"abi3",
"-",
"compliant",
"Extension",
"()"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/command/build_ext.py#L65-L71 | [
"def",
"get_abi3_suffix",
"(",
")",
":",
"for",
"suffix",
",",
"_",
",",
"_",
"in",
"(",
"s",
"for",
"s",
"in",
"imp",
".",
"get_suffixes",
"(",
")",
"if",
"s",
"[",
"2",
"]",
"==",
"imp",
".",
"C_EXTENSION",
")",
":",
"if",
"'.abi3'",
"in",
"s... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | build_ext.run | Build extensions in build directory, then copy if --inplace | setuptools/command/build_ext.py | def run(self):
"""Build extensions in build directory, then copy if --inplace"""
old_inplace, self.inplace = self.inplace, 0
_build_ext.run(self)
self.inplace = old_inplace
if old_inplace:
self.copy_extensions_to_source() | def run(self):
"""Build extensions in build directory, then copy if --inplace"""
old_inplace, self.inplace = self.inplace, 0
_build_ext.run(self)
self.inplace = old_inplace
if old_inplace:
self.copy_extensions_to_source() | [
"Build",
"extensions",
"in",
"build",
"directory",
"then",
"copy",
"if",
"--",
"inplace"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/command/build_ext.py#L75-L81 | [
"def",
"run",
"(",
"self",
")",
":",
"old_inplace",
",",
"self",
".",
"inplace",
"=",
"self",
".",
"inplace",
",",
"0",
"_build_ext",
".",
"run",
"(",
"self",
")",
"self",
".",
"inplace",
"=",
"old_inplace",
"if",
"old_inplace",
":",
"self",
".",
"co... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | override_temp | Monkey-patch tempfile.tempdir with replacement, ensuring it exists | setuptools/sandbox.py | def override_temp(replacement):
"""
Monkey-patch tempfile.tempdir with replacement, ensuring it exists
"""
pkg_resources.py31compat.makedirs(replacement, exist_ok=True)
saved = tempfile.tempdir
tempfile.tempdir = replacement
try:
yield
finally:
tempfile.tempdir = saved | def override_temp(replacement):
"""
Monkey-patch tempfile.tempdir with replacement, ensuring it exists
"""
pkg_resources.py31compat.makedirs(replacement, exist_ok=True)
saved = tempfile.tempdir
tempfile.tempdir = replacement
try:
yield
finally:
tempfile.tempdir = saved | [
"Monkey",
"-",
"patch",
"tempfile",
".",
"tempdir",
"with",
"replacement",
"ensuring",
"it",
"exists"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L69-L82 | [
"def",
"override_temp",
"(",
"replacement",
")",
":",
"pkg_resources",
".",
"py31compat",
".",
"makedirs",
"(",
"replacement",
",",
"exist_ok",
"=",
"True",
")",
"saved",
"=",
"tempfile",
".",
"tempdir",
"tempfile",
".",
"tempdir",
"=",
"replacement",
"try",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | save_modules | Context in which imported modules are saved.
Translates exceptions internal to the context into the equivalent exception
outside the context. | setuptools/sandbox.py | def save_modules():
"""
Context in which imported modules are saved.
Translates exceptions internal to the context into the equivalent exception
outside the context.
"""
saved = sys.modules.copy()
with ExceptionSaver() as saved_exc:
yield saved
sys.modules.update(saved)
# r... | def save_modules():
"""
Context in which imported modules are saved.
Translates exceptions internal to the context into the equivalent exception
outside the context.
"""
saved = sys.modules.copy()
with ExceptionSaver() as saved_exc:
yield saved
sys.modules.update(saved)
# r... | [
"Context",
"in",
"which",
"imported",
"modules",
"are",
"saved",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L145-L166 | [
"def",
"save_modules",
"(",
")",
":",
"saved",
"=",
"sys",
".",
"modules",
".",
"copy",
"(",
")",
"with",
"ExceptionSaver",
"(",
")",
"as",
"saved_exc",
":",
"yield",
"saved",
"sys",
".",
"modules",
".",
"update",
"(",
"saved",
")",
"# remove any modules... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | _needs_hiding | >>> _needs_hiding('setuptools')
True
>>> _needs_hiding('pkg_resources')
True
>>> _needs_hiding('setuptools_plugin')
False
>>> _needs_hiding('setuptools.__init__')
True
>>> _needs_hiding('distutils')
True
>>> _needs_hiding('os')
False
>>> _needs_hiding('Cython')
True | setuptools/sandbox.py | def _needs_hiding(mod_name):
"""
>>> _needs_hiding('setuptools')
True
>>> _needs_hiding('pkg_resources')
True
>>> _needs_hiding('setuptools_plugin')
False
>>> _needs_hiding('setuptools.__init__')
True
>>> _needs_hiding('distutils')
True
>>> _needs_hiding('os')
False
... | def _needs_hiding(mod_name):
"""
>>> _needs_hiding('setuptools')
True
>>> _needs_hiding('pkg_resources')
True
>>> _needs_hiding('setuptools_plugin')
False
>>> _needs_hiding('setuptools.__init__')
True
>>> _needs_hiding('distutils')
True
>>> _needs_hiding('os')
False
... | [
">>>",
"_needs_hiding",
"(",
"setuptools",
")",
"True",
">>>",
"_needs_hiding",
"(",
"pkg_resources",
")",
"True",
">>>",
"_needs_hiding",
"(",
"setuptools_plugin",
")",
"False",
">>>",
"_needs_hiding",
"(",
"setuptools",
".",
"__init__",
")",
"True",
">>>",
"_n... | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L198-L216 | [
"def",
"_needs_hiding",
"(",
"mod_name",
")",
":",
"pattern",
"=",
"re",
".",
"compile",
"(",
"r'(setuptools|pkg_resources|distutils|Cython)(\\.|$)'",
")",
"return",
"bool",
"(",
"pattern",
".",
"match",
"(",
"mod_name",
")",
")"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | run_setup | Run a distutils setup script, sandboxed in its directory | setuptools/sandbox.py | def run_setup(setup_script, args):
"""Run a distutils setup script, sandboxed in its directory"""
setup_dir = os.path.abspath(os.path.dirname(setup_script))
with setup_context(setup_dir):
try:
sys.argv[:] = [setup_script] + list(args)
sys.path.insert(0, setup_dir)
... | def run_setup(setup_script, args):
"""Run a distutils setup script, sandboxed in its directory"""
setup_dir = os.path.abspath(os.path.dirname(setup_script))
with setup_context(setup_dir):
try:
sys.argv[:] = [setup_script] + list(args)
sys.path.insert(0, setup_dir)
... | [
"Run",
"a",
"distutils",
"setup",
"script",
"sandboxed",
"in",
"its",
"directory"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L230-L253 | [
"def",
"run_setup",
"(",
"setup_script",
",",
"args",
")",
":",
"setup_dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"setup_script",
")",
")",
"with",
"setup_context",
"(",
"setup_dir",
")",
":",
"try",
":",... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | UnpickleableException.dump | Always return a dumped (pickled) type and exc. If exc can't be pickled,
wrap it in UnpickleableException first. | setuptools/sandbox.py | def dump(type, exc):
"""
Always return a dumped (pickled) type and exc. If exc can't be pickled,
wrap it in UnpickleableException first.
"""
try:
return pickle.dumps(type), pickle.dumps(exc)
except Exception:
# get UnpickleableException inside the ... | def dump(type, exc):
"""
Always return a dumped (pickled) type and exc. If exc can't be pickled,
wrap it in UnpickleableException first.
"""
try:
return pickle.dumps(type), pickle.dumps(exc)
except Exception:
# get UnpickleableException inside the ... | [
"Always",
"return",
"a",
"dumped",
"(",
"pickled",
")",
"type",
"and",
"exc",
".",
"If",
"exc",
"can",
"t",
"be",
"pickled",
"wrap",
"it",
"in",
"UnpickleableException",
"first",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L101-L111 | [
"def",
"dump",
"(",
"type",
",",
"exc",
")",
":",
"try",
":",
"return",
"pickle",
".",
"dumps",
"(",
"type",
")",
",",
"pickle",
".",
"dumps",
"(",
"exc",
")",
"except",
"Exception",
":",
"# get UnpickleableException inside the sandbox",
"from",
"setuptools"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ExceptionSaver.resume | restore and re-raise any exception | setuptools/sandbox.py | def resume(self):
"restore and re-raise any exception"
if '_saved' not in vars(self):
return
type, exc = map(pickle.loads, self._saved)
six.reraise(type, exc, self._tb) | def resume(self):
"restore and re-raise any exception"
if '_saved' not in vars(self):
return
type, exc = map(pickle.loads, self._saved)
six.reraise(type, exc, self._tb) | [
"restore",
"and",
"re",
"-",
"raise",
"any",
"exception"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L134-L141 | [
"def",
"resume",
"(",
"self",
")",
":",
"if",
"'_saved'",
"not",
"in",
"vars",
"(",
"self",
")",
":",
"return",
"type",
",",
"exc",
"=",
"map",
"(",
"pickle",
".",
"loads",
",",
"self",
".",
"_saved",
")",
"six",
".",
"reraise",
"(",
"type",
",",... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | AbstractSandbox._remap_pair | Called for path pairs like rename, link, and symlink operations | setuptools/sandbox.py | def _remap_pair(self, operation, src, dst, *args, **kw):
"""Called for path pairs like rename, link, and symlink operations"""
return (
self._remap_input(operation + '-from', src, *args, **kw),
self._remap_input(operation + '-to', dst, *args, **kw)
) | def _remap_pair(self, operation, src, dst, *args, **kw):
"""Called for path pairs like rename, link, and symlink operations"""
return (
self._remap_input(operation + '-from', src, *args, **kw),
self._remap_input(operation + '-to', dst, *args, **kw)
) | [
"Called",
"for",
"path",
"pairs",
"like",
"rename",
"link",
"and",
"symlink",
"operations"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L368-L373 | [
"def",
"_remap_pair",
"(",
"self",
",",
"operation",
",",
"src",
",",
"dst",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"return",
"(",
"self",
".",
"_remap_input",
"(",
"operation",
"+",
"'-from'",
",",
"src",
",",
"*",
"args",
",",
"*",
"*... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | DirectorySandbox._remap_input | Called for path inputs | setuptools/sandbox.py | def _remap_input(self, operation, path, *args, **kw):
"""Called for path inputs"""
if operation in self.write_ops and not self._ok(path):
self._violation(operation, os.path.realpath(path), *args, **kw)
return path | def _remap_input(self, operation, path, *args, **kw):
"""Called for path inputs"""
if operation in self.write_ops and not self._ok(path):
self._violation(operation, os.path.realpath(path), *args, **kw)
return path | [
"Called",
"for",
"path",
"inputs"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L449-L453 | [
"def",
"_remap_input",
"(",
"self",
",",
"operation",
",",
"path",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"if",
"operation",
"in",
"self",
".",
"write_ops",
"and",
"not",
"self",
".",
"_ok",
"(",
"path",
")",
":",
"self",
".",
"_violation... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | DirectorySandbox._remap_pair | Called for path pairs like rename, link, and symlink operations | setuptools/sandbox.py | def _remap_pair(self, operation, src, dst, *args, **kw):
"""Called for path pairs like rename, link, and symlink operations"""
if not self._ok(src) or not self._ok(dst):
self._violation(operation, src, dst, *args, **kw)
return (src, dst) | def _remap_pair(self, operation, src, dst, *args, **kw):
"""Called for path pairs like rename, link, and symlink operations"""
if not self._ok(src) or not self._ok(dst):
self._violation(operation, src, dst, *args, **kw)
return (src, dst) | [
"Called",
"for",
"path",
"pairs",
"like",
"rename",
"link",
"and",
"symlink",
"operations"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/sandbox.py#L455-L459 | [
"def",
"_remap_pair",
"(",
"self",
",",
"operation",
",",
"src",
",",
"dst",
",",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"if",
"not",
"self",
".",
"_ok",
"(",
"src",
")",
"or",
"not",
"self",
".",
"_ok",
"(",
"dst",
")",
":",
"self",
"."... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | _get_mro | Returns the bases classes for cls sorted by the MRO.
Works around an issue on Jython where inspect.getmro will not return all
base classes if multiple classes share the same name. Instead, this
function will return a tuple containing the class itself, and the contents
of cls.__bases__. See https://gith... | setuptools/monkey.py | def _get_mro(cls):
"""
Returns the bases classes for cls sorted by the MRO.
Works around an issue on Jython where inspect.getmro will not return all
base classes if multiple classes share the same name. Instead, this
function will return a tuple containing the class itself, and the contents
of ... | def _get_mro(cls):
"""
Returns the bases classes for cls sorted by the MRO.
Works around an issue on Jython where inspect.getmro will not return all
base classes if multiple classes share the same name. Instead, this
function will return a tuple containing the class itself, and the contents
of ... | [
"Returns",
"the",
"bases",
"classes",
"for",
"cls",
"sorted",
"by",
"the",
"MRO",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/monkey.py#L24-L35 | [
"def",
"_get_mro",
"(",
"cls",
")",
":",
"if",
"platform",
".",
"python_implementation",
"(",
")",
"==",
"\"Jython\"",
":",
"return",
"(",
"cls",
",",
")",
"+",
"cls",
".",
"__bases__",
"return",
"inspect",
".",
"getmro",
"(",
"cls",
")"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | get_unpatched_class | Protect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first. | setuptools/monkey.py | def get_unpatched_class(cls):
"""Protect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first.
"""
external_bases = (
cls
for cls in _get_mro(cls)
if not cls.__module__.startswith('setuptools')
)
... | def get_unpatched_class(cls):
"""Protect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first.
"""
external_bases = (
cls
for cls in _get_mro(cls)
if not cls.__module__.startswith('setuptools')
)
... | [
"Protect",
"against",
"re",
"-",
"patching",
"the",
"distutils",
"if",
"reloaded"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/monkey.py#L47-L62 | [
"def",
"get_unpatched_class",
"(",
"cls",
")",
":",
"external_bases",
"=",
"(",
"cls",
"for",
"cls",
"in",
"_get_mro",
"(",
"cls",
")",
"if",
"not",
"cls",
".",
"__module__",
".",
"startswith",
"(",
"'setuptools'",
")",
")",
"base",
"=",
"next",
"(",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | _patch_distribution_metadata | Patch write_pkg_file and read_pkg_file for higher metadata standards | setuptools/monkey.py | def _patch_distribution_metadata():
"""Patch write_pkg_file and read_pkg_file for higher metadata standards"""
for attr in ('write_pkg_file', 'read_pkg_file', 'get_metadata_version'):
new_val = getattr(setuptools.dist, attr)
setattr(distutils.dist.DistributionMetadata, attr, new_val) | def _patch_distribution_metadata():
"""Patch write_pkg_file and read_pkg_file for higher metadata standards"""
for attr in ('write_pkg_file', 'read_pkg_file', 'get_metadata_version'):
new_val = getattr(setuptools.dist, attr)
setattr(distutils.dist.DistributionMetadata, attr, new_val) | [
"Patch",
"write_pkg_file",
"and",
"read_pkg_file",
"for",
"higher",
"metadata",
"standards"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/monkey.py#L104-L108 | [
"def",
"_patch_distribution_metadata",
"(",
")",
":",
"for",
"attr",
"in",
"(",
"'write_pkg_file'",
",",
"'read_pkg_file'",
",",
"'get_metadata_version'",
")",
":",
"new_val",
"=",
"getattr",
"(",
"setuptools",
".",
"dist",
",",
"attr",
")",
"setattr",
"(",
"d... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | patch_func | Patch func_name in target_mod with replacement
Important - original must be resolved by name to avoid
patching an already patched function. | setuptools/monkey.py | def patch_func(replacement, target_mod, func_name):
"""
Patch func_name in target_mod with replacement
Important - original must be resolved by name to avoid
patching an already patched function.
"""
original = getattr(target_mod, func_name)
# set the 'unpatched' attribute on the replaceme... | def patch_func(replacement, target_mod, func_name):
"""
Patch func_name in target_mod with replacement
Important - original must be resolved by name to avoid
patching an already patched function.
"""
original = getattr(target_mod, func_name)
# set the 'unpatched' attribute on the replaceme... | [
"Patch",
"func_name",
"in",
"target_mod",
"with",
"replacement"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/monkey.py#L111-L125 | [
"def",
"patch_func",
"(",
"replacement",
",",
"target_mod",
",",
"func_name",
")",
":",
"original",
"=",
"getattr",
"(",
"target_mod",
",",
"func_name",
")",
"# set the 'unpatched' attribute on the replacement to",
"# point to the original.",
"vars",
"(",
"replacement",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | patch_for_msvc_specialized_compiler | Patch functions in distutils to use standalone Microsoft Visual C++
compilers. | setuptools/monkey.py | def patch_for_msvc_specialized_compiler():
"""
Patch functions in distutils to use standalone Microsoft Visual C++
compilers.
"""
# import late to avoid circular imports on Python < 3.5
msvc = import_module('setuptools.msvc')
if platform.system() != 'Windows':
# Compilers only avail... | def patch_for_msvc_specialized_compiler():
"""
Patch functions in distutils to use standalone Microsoft Visual C++
compilers.
"""
# import late to avoid circular imports on Python < 3.5
msvc = import_module('setuptools.msvc')
if platform.system() != 'Windows':
# Compilers only avail... | [
"Patch",
"functions",
"in",
"distutils",
"to",
"use",
"standalone",
"Microsoft",
"Visual",
"C",
"++",
"compilers",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/monkey.py#L132-L179 | [
"def",
"patch_for_msvc_specialized_compiler",
"(",
")",
":",
"# import late to avoid circular imports on Python < 3.5",
"msvc",
"=",
"import_module",
"(",
"'setuptools.msvc'",
")",
"if",
"platform",
".",
"system",
"(",
")",
"!=",
"'Windows'",
":",
"# Compilers only availabl... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | escape | Escape all special characters. | setuptools/glob.py | def escape(pathname):
"""Escape all special characters.
"""
# Escaping is done by wrapping any of "*?[" between square brackets.
# Metacharacters do not work in the drive part and shouldn't be escaped.
drive, pathname = os.path.splitdrive(pathname)
if isinstance(pathname, bytes):
pathnam... | def escape(pathname):
"""Escape all special characters.
"""
# Escaping is done by wrapping any of "*?[" between square brackets.
# Metacharacters do not work in the drive part and shouldn't be escaped.
drive, pathname = os.path.splitdrive(pathname)
if isinstance(pathname, bytes):
pathnam... | [
"Escape",
"all",
"special",
"characters",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/glob.py#L164-L174 | [
"def",
"escape",
"(",
"pathname",
")",
":",
"# Escaping is done by wrapping any of \"*?[\" between square brackets.",
"# Metacharacters do not work in the drive part and shouldn't be escaped.",
"drive",
",",
"pathname",
"=",
"os",
".",
"path",
".",
"splitdrive",
"(",
"pathname",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | upload_docs._build_multipart | Build up the MIME payload for the POST data | setuptools/command/upload_docs.py | def _build_multipart(cls, data):
"""
Build up the MIME payload for the POST data
"""
boundary = b'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
sep_boundary = b'\n--' + boundary
end_boundary = sep_boundary + b'--'
end_items = end_boundary, b"\n",
bu... | def _build_multipart(cls, data):
"""
Build up the MIME payload for the POST data
"""
boundary = b'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
sep_boundary = b'\n--' + boundary
end_boundary = sep_boundary + b'--'
end_items = end_boundary, b"\n",
bu... | [
"Build",
"up",
"the",
"MIME",
"payload",
"for",
"the",
"POST",
"data"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/command/upload_docs.py#L126-L142 | [
"def",
"_build_multipart",
"(",
"cls",
",",
"data",
")",
":",
"boundary",
"=",
"b'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'",
"sep_boundary",
"=",
"b'\\n--'",
"+",
"boundary",
"end_boundary",
"=",
"sep_boundary",
"+",
"b'--'",
"end_items",
"=",
"end_boundary"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | unpack | Move everything under `src_dir` to `dst_dir`, and delete the former. | setuptools/wheel.py | def unpack(src_dir, dst_dir):
'''Move everything under `src_dir` to `dst_dir`, and delete the former.'''
for dirpath, dirnames, filenames in os.walk(src_dir):
subdir = os.path.relpath(dirpath, src_dir)
for f in filenames:
src = os.path.join(dirpath, f)
dst = os.path.join(... | def unpack(src_dir, dst_dir):
'''Move everything under `src_dir` to `dst_dir`, and delete the former.'''
for dirpath, dirnames, filenames in os.walk(src_dir):
subdir = os.path.relpath(dirpath, src_dir)
for f in filenames:
src = os.path.join(dirpath, f)
dst = os.path.join(... | [
"Move",
"everything",
"under",
"src_dir",
"to",
"dst_dir",
"and",
"delete",
"the",
"former",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/wheel.py#L37-L56 | [
"def",
"unpack",
"(",
"src_dir",
",",
"dst_dir",
")",
":",
"for",
"dirpath",
",",
"dirnames",
",",
"filenames",
"in",
"os",
".",
"walk",
"(",
"src_dir",
")",
":",
"subdir",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"dirpath",
",",
"src_dir",
")",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Wheel.tags | List tags (py_version, abi, platform) supported by this wheel. | setuptools/wheel.py | def tags(self):
'''List tags (py_version, abi, platform) supported by this wheel.'''
return itertools.product(
self.py_version.split('.'),
self.abi.split('.'),
self.platform.split('.'),
) | def tags(self):
'''List tags (py_version, abi, platform) supported by this wheel.'''
return itertools.product(
self.py_version.split('.'),
self.abi.split('.'),
self.platform.split('.'),
) | [
"List",
"tags",
"(",
"py_version",
"abi",
"platform",
")",
"supported",
"by",
"this",
"wheel",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/wheel.py#L69-L75 | [
"def",
"tags",
"(",
"self",
")",
":",
"return",
"itertools",
".",
"product",
"(",
"self",
".",
"py_version",
".",
"split",
"(",
"'.'",
")",
",",
"self",
".",
"abi",
".",
"split",
"(",
"'.'",
")",
",",
"self",
".",
"platform",
".",
"split",
"(",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Wheel.is_compatible | Is the wheel is compatible with the current platform? | setuptools/wheel.py | def is_compatible(self):
'''Is the wheel is compatible with the current platform?'''
supported_tags = pep425tags.get_supported()
return next((True for t in self.tags() if t in supported_tags), False) | def is_compatible(self):
'''Is the wheel is compatible with the current platform?'''
supported_tags = pep425tags.get_supported()
return next((True for t in self.tags() if t in supported_tags), False) | [
"Is",
"the",
"wheel",
"is",
"compatible",
"with",
"the",
"current",
"platform?"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/wheel.py#L77-L80 | [
"def",
"is_compatible",
"(",
"self",
")",
":",
"supported_tags",
"=",
"pep425tags",
".",
"get_supported",
"(",
")",
"return",
"next",
"(",
"(",
"True",
"for",
"t",
"in",
"self",
".",
"tags",
"(",
")",
"if",
"t",
"in",
"supported_tags",
")",
",",
"False... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Wheel.install_as_egg | Install wheel as an egg directory. | setuptools/wheel.py | def install_as_egg(self, destination_eggdir):
'''Install wheel as an egg directory.'''
with zipfile.ZipFile(self.filename) as zf:
self._install_as_egg(destination_eggdir, zf) | def install_as_egg(self, destination_eggdir):
'''Install wheel as an egg directory.'''
with zipfile.ZipFile(self.filename) as zf:
self._install_as_egg(destination_eggdir, zf) | [
"Install",
"wheel",
"as",
"an",
"egg",
"directory",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/wheel.py#L98-L101 | [
"def",
"install_as_egg",
"(",
"self",
",",
"destination_eggdir",
")",
":",
"with",
"zipfile",
".",
"ZipFile",
"(",
"self",
".",
"filename",
")",
"as",
"zf",
":",
"self",
".",
"_install_as_egg",
"(",
"destination_eggdir",
",",
"zf",
")"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Wheel._move_data_entries | Move data entries to their correct location. | setuptools/wheel.py | def _move_data_entries(destination_eggdir, dist_data):
"""Move data entries to their correct location."""
dist_data = os.path.join(destination_eggdir, dist_data)
dist_data_scripts = os.path.join(dist_data, 'scripts')
if os.path.exists(dist_data_scripts):
egg_info_scripts = os... | def _move_data_entries(destination_eggdir, dist_data):
"""Move data entries to their correct location."""
dist_data = os.path.join(destination_eggdir, dist_data)
dist_data_scripts = os.path.join(dist_data, 'scripts')
if os.path.exists(dist_data_scripts):
egg_info_scripts = os... | [
"Move",
"data",
"entries",
"to",
"their",
"correct",
"location",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/wheel.py#L172-L197 | [
"def",
"_move_data_entries",
"(",
"destination_eggdir",
",",
"dist_data",
")",
":",
"dist_data",
"=",
"os",
".",
"path",
".",
"join",
"(",
"destination_eggdir",
",",
"dist_data",
")",
"dist_data_scripts",
"=",
"os",
".",
"path",
".",
"join",
"(",
"dist_data",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | read_configuration | Read given configuration file and returns options from it as a dict.
:param str|unicode filepath: Path to configuration file
to get options from.
:param bool find_others: Whether to search for other configuration files
which could be on in various places.
:param bool ignore_option_errors:... | setuptools/config.py | def read_configuration(
filepath, find_others=False, ignore_option_errors=False):
"""Read given configuration file and returns options from it as a dict.
:param str|unicode filepath: Path to configuration file
to get options from.
:param bool find_others: Whether to search for other config... | def read_configuration(
filepath, find_others=False, ignore_option_errors=False):
"""Read given configuration file and returns options from it as a dict.
:param str|unicode filepath: Path to configuration file
to get options from.
:param bool find_others: Whether to search for other config... | [
"Read",
"given",
"configuration",
"file",
"and",
"returns",
"options",
"from",
"it",
"as",
"a",
"dict",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L21-L65 | [
"def",
"read_configuration",
"(",
"filepath",
",",
"find_others",
"=",
"False",
",",
"ignore_option_errors",
"=",
"False",
")",
":",
"from",
"setuptools",
".",
"dist",
"import",
"Distribution",
",",
"_Distribution",
"filepath",
"=",
"os",
".",
"path",
".",
"ab... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | _get_option | Given a target object and option key, get that option from
the target object, either through a get_{key} method or
from an attribute directly. | setuptools/config.py | def _get_option(target_obj, key):
"""
Given a target object and option key, get that option from
the target object, either through a get_{key} method or
from an attribute directly.
"""
getter_name = 'get_{key}'.format(**locals())
by_attribute = functools.partial(getattr, target_obj, key)
... | def _get_option(target_obj, key):
"""
Given a target object and option key, get that option from
the target object, either through a get_{key} method or
from an attribute directly.
"""
getter_name = 'get_{key}'.format(**locals())
by_attribute = functools.partial(getattr, target_obj, key)
... | [
"Given",
"a",
"target",
"object",
"and",
"option",
"key",
"get",
"that",
"option",
"from",
"the",
"target",
"object",
"either",
"through",
"a",
"get_",
"{",
"key",
"}",
"method",
"or",
"from",
"an",
"attribute",
"directly",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L68-L77 | [
"def",
"_get_option",
"(",
"target_obj",
",",
"key",
")",
":",
"getter_name",
"=",
"'get_{key}'",
".",
"format",
"(",
"*",
"*",
"locals",
"(",
")",
")",
"by_attribute",
"=",
"functools",
".",
"partial",
"(",
"getattr",
",",
"target_obj",
",",
"key",
")",... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | configuration_to_dict | Returns configuration data gathered by given handlers as a dict.
:param list[ConfigHandler] handlers: Handlers list,
usually from parse_configuration()
:rtype: dict | setuptools/config.py | def configuration_to_dict(handlers):
"""Returns configuration data gathered by given handlers as a dict.
:param list[ConfigHandler] handlers: Handlers list,
usually from parse_configuration()
:rtype: dict
"""
config_dict = defaultdict(dict)
for handler in handlers:
for option ... | def configuration_to_dict(handlers):
"""Returns configuration data gathered by given handlers as a dict.
:param list[ConfigHandler] handlers: Handlers list,
usually from parse_configuration()
:rtype: dict
"""
config_dict = defaultdict(dict)
for handler in handlers:
for option ... | [
"Returns",
"configuration",
"data",
"gathered",
"by",
"given",
"handlers",
"as",
"a",
"dict",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L80-L95 | [
"def",
"configuration_to_dict",
"(",
"handlers",
")",
":",
"config_dict",
"=",
"defaultdict",
"(",
"dict",
")",
"for",
"handler",
"in",
"handlers",
":",
"for",
"option",
"in",
"handler",
".",
"set_options",
":",
"value",
"=",
"_get_option",
"(",
"handler",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | parse_configuration | Performs additional parsing of configuration options
for a distribution.
Returns a list of used option handlers.
:param Distribution distribution:
:param dict command_options:
:param bool ignore_option_errors: Whether to silently ignore
options, values of which could not be resolved (e.g. ... | setuptools/config.py | def parse_configuration(
distribution, command_options, ignore_option_errors=False):
"""Performs additional parsing of configuration options
for a distribution.
Returns a list of used option handlers.
:param Distribution distribution:
:param dict command_options:
:param bool ignore_opt... | def parse_configuration(
distribution, command_options, ignore_option_errors=False):
"""Performs additional parsing of configuration options
for a distribution.
Returns a list of used option handlers.
:param Distribution distribution:
:param dict command_options:
:param bool ignore_opt... | [
"Performs",
"additional",
"parsing",
"of",
"configuration",
"options",
"for",
"a",
"distribution",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L98-L122 | [
"def",
"parse_configuration",
"(",
"distribution",
",",
"command_options",
",",
"ignore_option_errors",
"=",
"False",
")",
":",
"options",
"=",
"ConfigOptionsHandler",
"(",
"distribution",
",",
"command_options",
",",
"ignore_option_errors",
")",
"options",
".",
"pars... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._parse_list | Represents value as a list.
Value is split either by separator (defaults to comma) or by lines.
:param value:
:param separator: List items separator character.
:rtype: list | setuptools/config.py | def _parse_list(cls, value, separator=','):
"""Represents value as a list.
Value is split either by separator (defaults to comma) or by lines.
:param value:
:param separator: List items separator character.
:rtype: list
"""
if isinstance(value, list): # _get_pa... | def _parse_list(cls, value, separator=','):
"""Represents value as a list.
Value is split either by separator (defaults to comma) or by lines.
:param value:
:param separator: List items separator character.
:rtype: list
"""
if isinstance(value, list): # _get_pa... | [
"Represents",
"value",
"as",
"a",
"list",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L202-L219 | [
"def",
"_parse_list",
"(",
"cls",
",",
"value",
",",
"separator",
"=",
"','",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"# _get_parser_compound case",
"return",
"value",
"if",
"'\\n'",
"in",
"value",
":",
"value",
"=",
"value",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._parse_dict | Represents value as a dict.
:param value:
:rtype: dict | setuptools/config.py | def _parse_dict(cls, value):
"""Represents value as a dict.
:param value:
:rtype: dict
"""
separator = '='
result = {}
for line in cls._parse_list(value):
key, sep, val = line.partition(separator)
if sep != separator:
raise... | def _parse_dict(cls, value):
"""Represents value as a dict.
:param value:
:rtype: dict
"""
separator = '='
result = {}
for line in cls._parse_list(value):
key, sep, val = line.partition(separator)
if sep != separator:
raise... | [
"Represents",
"value",
"as",
"a",
"dict",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L222-L237 | [
"def",
"_parse_dict",
"(",
"cls",
",",
"value",
")",
":",
"separator",
"=",
"'='",
"result",
"=",
"{",
"}",
"for",
"line",
"in",
"cls",
".",
"_parse_list",
"(",
"value",
")",
":",
"key",
",",
"sep",
",",
"val",
"=",
"line",
".",
"partition",
"(",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._exclude_files_parser | Returns a parser function to make sure field inputs
are not files.
Parses a value after getting the key so error messages are
more informative.
:param key:
:rtype: callable | setuptools/config.py | def _exclude_files_parser(cls, key):
"""Returns a parser function to make sure field inputs
are not files.
Parses a value after getting the key so error messages are
more informative.
:param key:
:rtype: callable
"""
def parser(value):
exclud... | def _exclude_files_parser(cls, key):
"""Returns a parser function to make sure field inputs
are not files.
Parses a value after getting the key so error messages are
more informative.
:param key:
:rtype: callable
"""
def parser(value):
exclud... | [
"Returns",
"a",
"parser",
"function",
"to",
"make",
"sure",
"field",
"inputs",
"are",
"not",
"files",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L250-L267 | [
"def",
"_exclude_files_parser",
"(",
"cls",
",",
"key",
")",
":",
"def",
"parser",
"(",
"value",
")",
":",
"exclude_directive",
"=",
"'file:'",
"if",
"value",
".",
"startswith",
"(",
"exclude_directive",
")",
":",
"raise",
"ValueError",
"(",
"'Only strings are... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._parse_file | Represents value as a string, allowing including text
from nearest files using `file:` directive.
Directive is sandboxed and won't reach anything outside
directory with setup.py.
Examples:
file: README.rst, CHANGELOG.md, src/file.txt
:param str value:
:rtyp... | setuptools/config.py | def _parse_file(cls, value):
"""Represents value as a string, allowing including text
from nearest files using `file:` directive.
Directive is sandboxed and won't reach anything outside
directory with setup.py.
Examples:
file: README.rst, CHANGELOG.md, src/file.txt
... | def _parse_file(cls, value):
"""Represents value as a string, allowing including text
from nearest files using `file:` directive.
Directive is sandboxed and won't reach anything outside
directory with setup.py.
Examples:
file: README.rst, CHANGELOG.md, src/file.txt
... | [
"Represents",
"value",
"as",
"a",
"string",
"allowing",
"including",
"text",
"from",
"nearest",
"files",
"using",
"file",
":",
"directive",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L270-L298 | [
"def",
"_parse_file",
"(",
"cls",
",",
"value",
")",
":",
"include_directive",
"=",
"'file:'",
"if",
"not",
"isinstance",
"(",
"value",
",",
"string_types",
")",
":",
"return",
"value",
"if",
"not",
"value",
".",
"startswith",
"(",
"include_directive",
")",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._parse_attr | Represents value as a module attribute.
Examples:
attr: package.attr
attr: package.module.attr
:param str value:
:rtype: str | setuptools/config.py | def _parse_attr(cls, value, package_dir=None):
"""Represents value as a module attribute.
Examples:
attr: package.attr
attr: package.module.attr
:param str value:
:rtype: str
"""
attr_directive = 'attr:'
if not value.startswith(attr_direc... | def _parse_attr(cls, value, package_dir=None):
"""Represents value as a module attribute.
Examples:
attr: package.attr
attr: package.module.attr
:param str value:
:rtype: str
"""
attr_directive = 'attr:'
if not value.startswith(attr_direc... | [
"Represents",
"value",
"as",
"a",
"module",
"attribute",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L312-L354 | [
"def",
"_parse_attr",
"(",
"cls",
",",
"value",
",",
"package_dir",
"=",
"None",
")",
":",
"attr_directive",
"=",
"'attr:'",
"if",
"not",
"value",
".",
"startswith",
"(",
"attr_directive",
")",
":",
"return",
"value",
"attrs_path",
"=",
"value",
".",
"repl... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._get_parser_compound | Returns parser function to represents value as a list.
Parses a value applying given methods one after another.
:param parse_methods:
:rtype: callable | setuptools/config.py | def _get_parser_compound(cls, *parse_methods):
"""Returns parser function to represents value as a list.
Parses a value applying given methods one after another.
:param parse_methods:
:rtype: callable
"""
def parse(value):
parsed = value
for met... | def _get_parser_compound(cls, *parse_methods):
"""Returns parser function to represents value as a list.
Parses a value applying given methods one after another.
:param parse_methods:
:rtype: callable
"""
def parse(value):
parsed = value
for met... | [
"Returns",
"parser",
"function",
"to",
"represents",
"value",
"as",
"a",
"list",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L357-L373 | [
"def",
"_get_parser_compound",
"(",
"cls",
",",
"*",
"parse_methods",
")",
":",
"def",
"parse",
"(",
"value",
")",
":",
"parsed",
"=",
"value",
"for",
"method",
"in",
"parse_methods",
":",
"parsed",
"=",
"method",
"(",
"parsed",
")",
"return",
"parsed",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._parse_section_to_dict | Parses section options into a dictionary.
Optionally applies a given parser to values.
:param dict section_options:
:param callable values_parser:
:rtype: dict | setuptools/config.py | def _parse_section_to_dict(cls, section_options, values_parser=None):
"""Parses section options into a dictionary.
Optionally applies a given parser to values.
:param dict section_options:
:param callable values_parser:
:rtype: dict
"""
value = {}
values... | def _parse_section_to_dict(cls, section_options, values_parser=None):
"""Parses section options into a dictionary.
Optionally applies a given parser to values.
:param dict section_options:
:param callable values_parser:
:rtype: dict
"""
value = {}
values... | [
"Parses",
"section",
"options",
"into",
"a",
"dictionary",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L376-L389 | [
"def",
"_parse_section_to_dict",
"(",
"cls",
",",
"section_options",
",",
"values_parser",
"=",
"None",
")",
":",
"value",
"=",
"{",
"}",
"values_parser",
"=",
"values_parser",
"or",
"(",
"lambda",
"val",
":",
"val",
")",
"for",
"key",
",",
"(",
"_",
","... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler.parse_section | Parses configuration file section.
:param dict section_options: | setuptools/config.py | def parse_section(self, section_options):
"""Parses configuration file section.
:param dict section_options:
"""
for (name, (_, value)) in section_options.items():
try:
self[name] = value
except KeyError:
pass | def parse_section(self, section_options):
"""Parses configuration file section.
:param dict section_options:
"""
for (name, (_, value)) in section_options.items():
try:
self[name] = value
except KeyError:
pass | [
"Parses",
"configuration",
"file",
"section",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L391-L401 | [
"def",
"parse_section",
"(",
"self",
",",
"section_options",
")",
":",
"for",
"(",
"name",
",",
"(",
"_",
",",
"value",
")",
")",
"in",
"section_options",
".",
"items",
"(",
")",
":",
"try",
":",
"self",
"[",
"name",
"]",
"=",
"value",
"except",
"K... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigHandler._deprecated_config_handler | this function will wrap around parameters that are deprecated
:param msg: deprecation message
:param warning_class: class of warning exception to be raised
:param func: function to be wrapped around | setuptools/config.py | def _deprecated_config_handler(self, func, msg, warning_class):
""" this function will wrap around parameters that are deprecated
:param msg: deprecation message
:param warning_class: class of warning exception to be raised
:param func: function to be wrapped around
"""
... | def _deprecated_config_handler(self, func, msg, warning_class):
""" this function will wrap around parameters that are deprecated
:param msg: deprecation message
:param warning_class: class of warning exception to be raised
:param func: function to be wrapped around
"""
... | [
"this",
"function",
"will",
"wrap",
"around",
"parameters",
"that",
"are",
"deprecated"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L427-L439 | [
"def",
"_deprecated_config_handler",
"(",
"self",
",",
"func",
",",
"msg",
",",
"warning_class",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"config_handler",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"msg"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigMetadataHandler.parsers | Metadata item name to parser function mapping. | setuptools/config.py | def parsers(self):
"""Metadata item name to parser function mapping."""
parse_list = self._parse_list
parse_file = self._parse_file
parse_dict = self._parse_dict
exclude_files_parser = self._exclude_files_parser
return {
'platforms': parse_list,
'... | def parsers(self):
"""Metadata item name to parser function mapping."""
parse_list = self._parse_list
parse_file = self._parse_file
parse_dict = self._parse_dict
exclude_files_parser = self._exclude_files_parser
return {
'platforms': parse_list,
'... | [
"Metadata",
"item",
"name",
"to",
"parser",
"function",
"mapping",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L466-L489 | [
"def",
"parsers",
"(",
"self",
")",
":",
"parse_list",
"=",
"self",
".",
"_parse_list",
"parse_file",
"=",
"self",
".",
"_parse_file",
"parse_dict",
"=",
"self",
".",
"_parse_dict",
"exclude_files_parser",
"=",
"self",
".",
"_exclude_files_parser",
"return",
"{"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigMetadataHandler._parse_version | Parses `version` option value.
:param value:
:rtype: str | setuptools/config.py | def _parse_version(self, value):
"""Parses `version` option value.
:param value:
:rtype: str
"""
version = self._parse_file(value)
if version != value:
version = version.strip()
# Be strict about versions loaded from file because it's easy to
... | def _parse_version(self, value):
"""Parses `version` option value.
:param value:
:rtype: str
"""
version = self._parse_file(value)
if version != value:
version = version.strip()
# Be strict about versions loaded from file because it's easy to
... | [
"Parses",
"version",
"option",
"value",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L491-L524 | [
"def",
"_parse_version",
"(",
"self",
",",
"value",
")",
":",
"version",
"=",
"self",
".",
"_parse_file",
"(",
"value",
")",
"if",
"version",
"!=",
"value",
":",
"version",
"=",
"version",
".",
"strip",
"(",
")",
"# Be strict about versions loaded from file be... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigOptionsHandler.parsers | Metadata item name to parser function mapping. | setuptools/config.py | def parsers(self):
"""Metadata item name to parser function mapping."""
parse_list = self._parse_list
parse_list_semicolon = partial(self._parse_list, separator=';')
parse_bool = self._parse_bool
parse_dict = self._parse_dict
return {
'zip_safe': parse_bool,
... | def parsers(self):
"""Metadata item name to parser function mapping."""
parse_list = self._parse_list
parse_list_semicolon = partial(self._parse_list, separator=';')
parse_bool = self._parse_bool
parse_dict = self._parse_dict
return {
'zip_safe': parse_bool,
... | [
"Metadata",
"item",
"name",
"to",
"parser",
"function",
"mapping",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L532-L557 | [
"def",
"parsers",
"(",
"self",
")",
":",
"parse_list",
"=",
"self",
".",
"_parse_list",
"parse_list_semicolon",
"=",
"partial",
"(",
"self",
".",
"_parse_list",
",",
"separator",
"=",
"';'",
")",
"parse_bool",
"=",
"self",
".",
"_parse_bool",
"parse_dict",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigOptionsHandler._parse_packages | Parses `packages` option value.
:param value:
:rtype: list | setuptools/config.py | def _parse_packages(self, value):
"""Parses `packages` option value.
:param value:
:rtype: list
"""
find_directives = ['find:', 'find_namespace:']
trimmed_value = value.strip()
if trimmed_value not in find_directives:
return self._parse_list(value)
... | def _parse_packages(self, value):
"""Parses `packages` option value.
:param value:
:rtype: list
"""
find_directives = ['find:', 'find_namespace:']
trimmed_value = value.strip()
if trimmed_value not in find_directives:
return self._parse_list(value)
... | [
"Parses",
"packages",
"option",
"value",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L559-L585 | [
"def",
"_parse_packages",
"(",
"self",
",",
"value",
")",
":",
"find_directives",
"=",
"[",
"'find:'",
",",
"'find_namespace:'",
"]",
"trimmed_value",
"=",
"value",
".",
"strip",
"(",
")",
"if",
"trimmed_value",
"not",
"in",
"find_directives",
":",
"return",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigOptionsHandler.parse_section_packages__find | Parses `packages.find` configuration file section.
To be used in conjunction with _parse_packages().
:param dict section_options: | setuptools/config.py | def parse_section_packages__find(self, section_options):
"""Parses `packages.find` configuration file section.
To be used in conjunction with _parse_packages().
:param dict section_options:
"""
section_data = self._parse_section_to_dict(
section_options, self._parse... | def parse_section_packages__find(self, section_options):
"""Parses `packages.find` configuration file section.
To be used in conjunction with _parse_packages().
:param dict section_options:
"""
section_data = self._parse_section_to_dict(
section_options, self._parse... | [
"Parses",
"packages",
".",
"find",
"configuration",
"file",
"section",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L587-L606 | [
"def",
"parse_section_packages__find",
"(",
"self",
",",
"section_options",
")",
":",
"section_data",
"=",
"self",
".",
"_parse_section_to_dict",
"(",
"section_options",
",",
"self",
".",
"_parse_list",
")",
"valid_keys",
"=",
"[",
"'where'",
",",
"'include'",
","... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigOptionsHandler.parse_section_entry_points | Parses `entry_points` configuration file section.
:param dict section_options: | setuptools/config.py | def parse_section_entry_points(self, section_options):
"""Parses `entry_points` configuration file section.
:param dict section_options:
"""
parsed = self._parse_section_to_dict(section_options, self._parse_list)
self['entry_points'] = parsed | def parse_section_entry_points(self, section_options):
"""Parses `entry_points` configuration file section.
:param dict section_options:
"""
parsed = self._parse_section_to_dict(section_options, self._parse_list)
self['entry_points'] = parsed | [
"Parses",
"entry_points",
"configuration",
"file",
"section",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L608-L614 | [
"def",
"parse_section_entry_points",
"(",
"self",
",",
"section_options",
")",
":",
"parsed",
"=",
"self",
".",
"_parse_section_to_dict",
"(",
"section_options",
",",
"self",
".",
"_parse_list",
")",
"self",
"[",
"'entry_points'",
"]",
"=",
"parsed"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigOptionsHandler.parse_section_extras_require | Parses `extras_require` configuration file section.
:param dict section_options: | setuptools/config.py | def parse_section_extras_require(self, section_options):
"""Parses `extras_require` configuration file section.
:param dict section_options:
"""
parse_list = partial(self._parse_list, separator=';')
self['extras_require'] = self._parse_section_to_dict(
section_option... | def parse_section_extras_require(self, section_options):
"""Parses `extras_require` configuration file section.
:param dict section_options:
"""
parse_list = partial(self._parse_list, separator=';')
self['extras_require'] = self._parse_section_to_dict(
section_option... | [
"Parses",
"extras_require",
"configuration",
"file",
"section",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L641-L648 | [
"def",
"parse_section_extras_require",
"(",
"self",
",",
"section_options",
")",
":",
"parse_list",
"=",
"partial",
"(",
"self",
".",
"_parse_list",
",",
"separator",
"=",
"';'",
")",
"self",
"[",
"'extras_require'",
"]",
"=",
"self",
".",
"_parse_section_to_dic... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | ConfigOptionsHandler.parse_section_data_files | Parses `data_files` configuration file section.
:param dict section_options: | setuptools/config.py | def parse_section_data_files(self, section_options):
"""Parses `data_files` configuration file section.
:param dict section_options:
"""
parsed = self._parse_section_to_dict(section_options, self._parse_list)
self['data_files'] = [(k, v) for k, v in parsed.items()] | def parse_section_data_files(self, section_options):
"""Parses `data_files` configuration file section.
:param dict section_options:
"""
parsed = self._parse_section_to_dict(section_options, self._parse_list)
self['data_files'] = [(k, v) for k, v in parsed.items()] | [
"Parses",
"data_files",
"configuration",
"file",
"section",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/config.py#L650-L656 | [
"def",
"parse_section_data_files",
"(",
"self",
",",
"section_options",
")",
":",
"parsed",
"=",
"self",
".",
"_parse_section_to_dict",
"(",
"section_options",
",",
"self",
".",
"_parse_list",
")",
"self",
"[",
"'data_files'",
"]",
"=",
"[",
"(",
"k",
",",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | read_pkg_file | Reads the metadata values from a file object. | setuptools/dist.py | def read_pkg_file(self, file):
"""Reads the metadata values from a file object."""
msg = message_from_file(file)
def _read_field(name):
value = msg[name]
if value == 'UNKNOWN':
return None
return value
def _read_list(name):
values = msg.get_all(name, None)
... | def read_pkg_file(self, file):
"""Reads the metadata values from a file object."""
msg = message_from_file(file)
def _read_field(name):
value = msg[name]
if value == 'UNKNOWN':
return None
return value
def _read_list(name):
values = msg.get_all(name, None)
... | [
"Reads",
"the",
"metadata",
"values",
"from",
"a",
"file",
"object",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L70-L120 | [
"def",
"read_pkg_file",
"(",
"self",
",",
"file",
")",
":",
"msg",
"=",
"message_from_file",
"(",
"file",
")",
"def",
"_read_field",
"(",
"name",
")",
":",
"value",
"=",
"msg",
"[",
"name",
"]",
"if",
"value",
"==",
"'UNKNOWN'",
":",
"return",
"None",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | write_pkg_file | Write the PKG-INFO format data to a file object. | setuptools/dist.py | def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object.
"""
version = self.get_metadata_version()
if six.PY2:
def write_field(key, value):
file.write("%s: %s\n" % (key, self._encode_field(value)))
else:
def write_field(key, value):
... | def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object.
"""
version = self.get_metadata_version()
if six.PY2:
def write_field(key, value):
file.write("%s: %s\n" % (key, self._encode_field(value)))
else:
def write_field(key, value):
... | [
"Write",
"the",
"PKG",
"-",
"INFO",
"format",
"data",
"to",
"a",
"file",
"object",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L124-L197 | [
"def",
"write_pkg_file",
"(",
"self",
",",
"file",
")",
":",
"version",
"=",
"self",
".",
"get_metadata_version",
"(",
")",
"if",
"six",
".",
"PY2",
":",
"def",
"write_field",
"(",
"key",
",",
"value",
")",
":",
"file",
".",
"write",
"(",
"\"%s: %s\\n\... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | assert_string_list | Verify that value is a string list or None | setuptools/dist.py | def assert_string_list(dist, attr, value):
"""Verify that value is a string list or None"""
try:
assert ''.join(value) != value
except (TypeError, ValueError, AttributeError, AssertionError):
raise DistutilsSetupError(
"%r must be a list of strings (got %r)" % (attr, value)
... | def assert_string_list(dist, attr, value):
"""Verify that value is a string list or None"""
try:
assert ''.join(value) != value
except (TypeError, ValueError, AttributeError, AssertionError):
raise DistutilsSetupError(
"%r must be a list of strings (got %r)" % (attr, value)
... | [
"Verify",
"that",
"value",
"is",
"a",
"string",
"list",
"or",
"None"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L214-L221 | [
"def",
"assert_string_list",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"try",
":",
"assert",
"''",
".",
"join",
"(",
"value",
")",
"!=",
"value",
"except",
"(",
"TypeError",
",",
"ValueError",
",",
"AttributeError",
",",
"AssertionError",
")",
":... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | check_nsp | Verify that namespace packages are valid | setuptools/dist.py | def check_nsp(dist, attr, value):
"""Verify that namespace packages are valid"""
ns_packages = value
assert_string_list(dist, attr, ns_packages)
for nsp in ns_packages:
if not dist.has_contents_for(nsp):
raise DistutilsSetupError(
"Distribution contains no modules or ... | def check_nsp(dist, attr, value):
"""Verify that namespace packages are valid"""
ns_packages = value
assert_string_list(dist, attr, ns_packages)
for nsp in ns_packages:
if not dist.has_contents_for(nsp):
raise DistutilsSetupError(
"Distribution contains no modules or ... | [
"Verify",
"that",
"namespace",
"packages",
"are",
"valid"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L224-L239 | [
"def",
"check_nsp",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"ns_packages",
"=",
"value",
"assert_string_list",
"(",
"dist",
",",
"attr",
",",
"ns_packages",
")",
"for",
"nsp",
"in",
"ns_packages",
":",
"if",
"not",
"dist",
".",
"has_contents_for"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | check_extras | Verify that extras_require mapping is valid | setuptools/dist.py | def check_extras(dist, attr, value):
"""Verify that extras_require mapping is valid"""
try:
list(itertools.starmap(_check_extra, value.items()))
except (TypeError, ValueError, AttributeError):
raise DistutilsSetupError(
"'extras_require' must be a dictionary whose values are "
... | def check_extras(dist, attr, value):
"""Verify that extras_require mapping is valid"""
try:
list(itertools.starmap(_check_extra, value.items()))
except (TypeError, ValueError, AttributeError):
raise DistutilsSetupError(
"'extras_require' must be a dictionary whose values are "
... | [
"Verify",
"that",
"extras_require",
"mapping",
"is",
"valid"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L242-L251 | [
"def",
"check_extras",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"try",
":",
"list",
"(",
"itertools",
".",
"starmap",
"(",
"_check_extra",
",",
"value",
".",
"items",
"(",
")",
")",
")",
"except",
"(",
"TypeError",
",",
"ValueError",
",",
"A... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | assert_bool | Verify that value is True, False, 0, or 1 | setuptools/dist.py | def assert_bool(dist, attr, value):
"""Verify that value is True, False, 0, or 1"""
if bool(value) != value:
tmpl = "{attr!r} must be a boolean value (got {value!r})"
raise DistutilsSetupError(tmpl.format(attr=attr, value=value)) | def assert_bool(dist, attr, value):
"""Verify that value is True, False, 0, or 1"""
if bool(value) != value:
tmpl = "{attr!r} must be a boolean value (got {value!r})"
raise DistutilsSetupError(tmpl.format(attr=attr, value=value)) | [
"Verify",
"that",
"value",
"is",
"True",
"False",
"0",
"or",
"1"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L261-L265 | [
"def",
"assert_bool",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"if",
"bool",
"(",
"value",
")",
"!=",
"value",
":",
"tmpl",
"=",
"\"{attr!r} must be a boolean value (got {value!r})\"",
"raise",
"DistutilsSetupError",
"(",
"tmpl",
".",
"format",
"(",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | check_specifier | Verify that value is a valid version specifier | setuptools/dist.py | def check_specifier(dist, attr, value):
"""Verify that value is a valid version specifier"""
try:
packaging.specifiers.SpecifierSet(value)
except packaging.specifiers.InvalidSpecifier as error:
tmpl = (
"{attr!r} must be a string "
"containing valid version specifiers... | def check_specifier(dist, attr, value):
"""Verify that value is a valid version specifier"""
try:
packaging.specifiers.SpecifierSet(value)
except packaging.specifiers.InvalidSpecifier as error:
tmpl = (
"{attr!r} must be a string "
"containing valid version specifiers... | [
"Verify",
"that",
"value",
"is",
"a",
"valid",
"version",
"specifier"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L282-L291 | [
"def",
"check_specifier",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"try",
":",
"packaging",
".",
"specifiers",
".",
"SpecifierSet",
"(",
"value",
")",
"except",
"packaging",
".",
"specifiers",
".",
"InvalidSpecifier",
"as",
"error",
":",
"tmpl",
"... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | check_package_data | Verify that value is a dictionary of package names to glob lists | setuptools/dist.py | def check_package_data(dist, attr, value):
"""Verify that value is a dictionary of package names to glob lists"""
if isinstance(value, dict):
for k, v in value.items():
if not isinstance(k, str):
break
try:
iter(v)
except TypeError:
... | def check_package_data(dist, attr, value):
"""Verify that value is a dictionary of package names to glob lists"""
if isinstance(value, dict):
for k, v in value.items():
if not isinstance(k, str):
break
try:
iter(v)
except TypeError:
... | [
"Verify",
"that",
"value",
"is",
"a",
"dictionary",
"of",
"package",
"names",
"to",
"glob",
"lists"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L307-L322 | [
"def",
"check_package_data",
"(",
"dist",
",",
"attr",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"for",
"k",
",",
"v",
"in",
"value",
".",
"items",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"k",
",",
"s... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution._finalize_requires | Set `metadata.python_requires` and fix environment markers
in `install_requires` and `extras_require`. | setuptools/dist.py | def _finalize_requires(self):
"""
Set `metadata.python_requires` and fix environment markers
in `install_requires` and `extras_require`.
"""
if getattr(self, 'python_requires', None):
self.metadata.python_requires = self.python_requires
if getattr(self, 'extr... | def _finalize_requires(self):
"""
Set `metadata.python_requires` and fix environment markers
in `install_requires` and `extras_require`.
"""
if getattr(self, 'python_requires', None):
self.metadata.python_requires = self.python_requires
if getattr(self, 'extr... | [
"Set",
"metadata",
".",
"python_requires",
"and",
"fix",
"environment",
"markers",
"in",
"install_requires",
"and",
"extras_require",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L485-L503 | [
"def",
"_finalize_requires",
"(",
"self",
")",
":",
"if",
"getattr",
"(",
"self",
",",
"'python_requires'",
",",
"None",
")",
":",
"self",
".",
"metadata",
".",
"python_requires",
"=",
"self",
".",
"python_requires",
"if",
"getattr",
"(",
"self",
",",
"'ex... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution._convert_extras_requirements | Convert requirements in `extras_require` of the form
`"extra": ["barbazquux; {marker}"]` to
`"extra:{marker}": ["barbazquux"]`. | setuptools/dist.py | def _convert_extras_requirements(self):
"""
Convert requirements in `extras_require` of the form
`"extra": ["barbazquux; {marker}"]` to
`"extra:{marker}": ["barbazquux"]`.
"""
spec_ext_reqs = getattr(self, 'extras_require', None) or {}
self._tmp_extras_require = d... | def _convert_extras_requirements(self):
"""
Convert requirements in `extras_require` of the form
`"extra": ["barbazquux; {marker}"]` to
`"extra:{marker}": ["barbazquux"]`.
"""
spec_ext_reqs = getattr(self, 'extras_require', None) or {}
self._tmp_extras_require = d... | [
"Convert",
"requirements",
"in",
"extras_require",
"of",
"the",
"form",
"extra",
":",
"[",
"barbazquux",
";",
"{",
"marker",
"}",
"]",
"to",
"extra",
":",
"{",
"marker",
"}",
":",
"[",
"barbazquux",
"]",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L505-L518 | [
"def",
"_convert_extras_requirements",
"(",
"self",
")",
":",
"spec_ext_reqs",
"=",
"getattr",
"(",
"self",
",",
"'extras_require'",
",",
"None",
")",
"or",
"{",
"}",
"self",
".",
"_tmp_extras_require",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"section",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution._move_install_requirements_markers | Move requirements in `install_requires` that are using environment
markers `extras_require`. | setuptools/dist.py | def _move_install_requirements_markers(self):
"""
Move requirements in `install_requires` that are using environment
markers `extras_require`.
"""
# divide the install_requires into two sets, simple ones still
# handled by install_requires and more complex ones handled
... | def _move_install_requirements_markers(self):
"""
Move requirements in `install_requires` that are using environment
markers `extras_require`.
"""
# divide the install_requires into two sets, simple ones still
# handled by install_requires and more complex ones handled
... | [
"Move",
"requirements",
"in",
"install_requires",
"that",
"are",
"using",
"environment",
"markers",
"extras_require",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L528-L552 | [
"def",
"_move_install_requirements_markers",
"(",
"self",
")",
":",
"# divide the install_requires into two sets, simple ones still",
"# handled by install_requires and more complex ones handled",
"# by extras_require.",
"def",
"is_simple_req",
"(",
"req",
")",
":",
"return",
"not",
... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution._parse_config_files | Adapted from distutils.dist.Distribution.parse_config_files,
this method provides the same functionality in subtly-improved
ways. | setuptools/dist.py | def _parse_config_files(self, filenames=None):
"""
Adapted from distutils.dist.Distribution.parse_config_files,
this method provides the same functionality in subtly-improved
ways.
"""
from setuptools.extern.six.moves.configparser import ConfigParser
# Ignore ins... | def _parse_config_files(self, filenames=None):
"""
Adapted from distutils.dist.Distribution.parse_config_files,
this method provides the same functionality in subtly-improved
ways.
"""
from setuptools.extern.six.moves.configparser import ConfigParser
# Ignore ins... | [
"Adapted",
"from",
"distutils",
".",
"dist",
".",
"Distribution",
".",
"parse_config_files",
"this",
"method",
"provides",
"the",
"same",
"functionality",
"in",
"subtly",
"-",
"improved",
"ways",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L561-L621 | [
"def",
"_parse_config_files",
"(",
"self",
",",
"filenames",
"=",
"None",
")",
":",
"from",
"setuptools",
".",
"extern",
".",
"six",
".",
"moves",
".",
"configparser",
"import",
"ConfigParser",
"# Ignore install directory options if we have a venv",
"if",
"six",
"."... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution._set_command_options | Set the options for 'command_obj' from 'option_dict'. Basically
this means copying elements of a dictionary ('option_dict') to
attributes of an instance ('command').
'command_obj' must be a Command instance. If 'option_dict' is not
supplied, uses the standard option dictionary for thi... | setuptools/dist.py | def _set_command_options(self, command_obj, option_dict=None):
"""
Set the options for 'command_obj' from 'option_dict'. Basically
this means copying elements of a dictionary ('option_dict') to
attributes of an instance ('command').
'command_obj' must be a Command instance. If... | def _set_command_options(self, command_obj, option_dict=None):
"""
Set the options for 'command_obj' from 'option_dict'. Basically
this means copying elements of a dictionary ('option_dict') to
attributes of an instance ('command').
'command_obj' must be a Command instance. If... | [
"Set",
"the",
"options",
"for",
"command_obj",
"from",
"option_dict",
".",
"Basically",
"this",
"means",
"copying",
"elements",
"of",
"a",
"dictionary",
"(",
"option_dict",
")",
"to",
"attributes",
"of",
"an",
"instance",
"(",
"command",
")",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L643-L688 | [
"def",
"_set_command_options",
"(",
"self",
",",
"command_obj",
",",
"option_dict",
"=",
"None",
")",
":",
"command_name",
"=",
"command_obj",
".",
"get_command_name",
"(",
")",
"if",
"option_dict",
"is",
"None",
":",
"option_dict",
"=",
"self",
".",
"get_opti... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution.parse_config_files | Parses configuration files from various levels
and loads configuration. | setuptools/dist.py | def parse_config_files(self, filenames=None, ignore_option_errors=False):
"""Parses configuration files from various levels
and loads configuration.
"""
self._parse_config_files(filenames=filenames)
parse_configuration(self, self.command_options,
ign... | def parse_config_files(self, filenames=None, ignore_option_errors=False):
"""Parses configuration files from various levels
and loads configuration.
"""
self._parse_config_files(filenames=filenames)
parse_configuration(self, self.command_options,
ign... | [
"Parses",
"configuration",
"files",
"from",
"various",
"levels",
"and",
"loads",
"configuration",
"."
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L690-L699 | [
"def",
"parse_config_files",
"(",
"self",
",",
"filenames",
"=",
"None",
",",
"ignore_option_errors",
"=",
"False",
")",
":",
"self",
".",
"_parse_config_files",
"(",
"filenames",
"=",
"filenames",
")",
"parse_configuration",
"(",
"self",
",",
"self",
".",
"co... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution.parse_command_line | Process features after parsing command line options | setuptools/dist.py | def parse_command_line(self):
"""Process features after parsing command line options"""
result = _Distribution.parse_command_line(self)
if self.features:
self._finalize_features()
return result | def parse_command_line(self):
"""Process features after parsing command line options"""
result = _Distribution.parse_command_line(self)
if self.features:
self._finalize_features()
return result | [
"Process",
"features",
"after",
"parsing",
"command",
"line",
"options"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L701-L706 | [
"def",
"parse_command_line",
"(",
"self",
")",
":",
"result",
"=",
"_Distribution",
".",
"parse_command_line",
"(",
"self",
")",
"if",
"self",
".",
"features",
":",
"self",
".",
"_finalize_features",
"(",
")",
"return",
"result"
] | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
train | Distribution.fetch_build_eggs | Resolve pre-setup requirements | setuptools/dist.py | def fetch_build_eggs(self, requires):
"""Resolve pre-setup requirements"""
resolved_dists = pkg_resources.working_set.resolve(
pkg_resources.parse_requirements(requires),
installer=self.fetch_build_egg,
replace_conflicting=True,
)
for dist in resolved_... | def fetch_build_eggs(self, requires):
"""Resolve pre-setup requirements"""
resolved_dists = pkg_resources.working_set.resolve(
pkg_resources.parse_requirements(requires),
installer=self.fetch_build_egg,
replace_conflicting=True,
)
for dist in resolved_... | [
"Resolve",
"pre",
"-",
"setup",
"requirements"
] | pypa/setuptools | python | https://github.com/pypa/setuptools/blob/83c667e0b2a98193851c07115d1af65011ed0fb6/setuptools/dist.py#L712-L721 | [
"def",
"fetch_build_eggs",
"(",
"self",
",",
"requires",
")",
":",
"resolved_dists",
"=",
"pkg_resources",
".",
"working_set",
".",
"resolve",
"(",
"pkg_resources",
".",
"parse_requirements",
"(",
"requires",
")",
",",
"installer",
"=",
"self",
".",
"fetch_build... | 83c667e0b2a98193851c07115d1af65011ed0fb6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.