[Python-checkins] cpython (merge 3.5 -> default): Merge from 3.5

steve.dower python-checkins at python.org
Mon Jun 27 12:36:04 EDT 2016


https://hg.python.org/cpython/rev/a14f425e1c4a
changeset:   102212:a14f425e1c4a
parent:      102210:f19c2b28710e
parent:      102211:ac03015d69d5
user:        Steve Dower <steve.dower at microsoft.com>
date:        Mon Jun 27 09:35:32 2016 -0700
summary:
  Merge from 3.5

files:
  Tools/msi/make_zip.py     |  34 +++++++++++++++++++-------
  Tools/nuget/make_pkg.proj |   6 +++-
  2 files changed, 29 insertions(+), 11 deletions(-)


diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py
--- a/Tools/msi/make_zip.py
+++ b/Tools/msi/make_zip.py
@@ -12,9 +12,19 @@
 import subprocess
 
 TKTCL_RE = re.compile(r'^(_?tk|tcl).+\.(pyd|dll)', re.IGNORECASE)
-DEBUG_RE = re.compile(r'_d\.(pyd|dll|exe)$', re.IGNORECASE)
+DEBUG_RE = re.compile(r'_d\.(pyd|dll|exe|pdb|lib)$', re.IGNORECASE)
 PYTHON_DLL_RE = re.compile(r'python\d\d?\.dll$', re.IGNORECASE)
 
+DEBUG_FILES = {
+    '_ctypes_test',
+    '_testbuffer',
+    '_testcapi',
+    '_testimportmultiple',
+    '_testmultiphase',
+    'xxlimited',
+    'python3_dstub',
+}
+
 EXCLUDE_FROM_LIBRARY = {
     '__pycache__',
     'ensurepip',
@@ -30,6 +40,12 @@
     'bdist_wininst.py',
 }
 
+EXCLUDE_FILE_FROM_LIBS = {
+    'ssleay',
+    'libeay',
+    'python3stub',
+}
+
 def is_not_debug(p):
     if DEBUG_RE.search(p.name):
         return False
@@ -37,14 +53,7 @@
     if TKTCL_RE.search(p.name):
         return False
 
-    return p.name.lower() not in {
-        '_ctypes_test.pyd',
-        '_testbuffer.pyd',
-        '_testcapi.pyd',
-        '_testimportmultiple.pyd',
-        '_testmultiphase.pyd',
-        'xxlimited.pyd',
-    }
+    return p.stem.lower() not in DEBUG_FILES
 
 def is_not_debug_or_python(p):
     return is_not_debug(p) and not PYTHON_DLL_RE.search(p.name)
@@ -68,6 +77,12 @@
     suffix = p.suffix.lower()
     return suffix not in {'.pyc', '.pyo', '.exe'}
 
+def include_in_libs(p):
+    if not is_not_debug(p):
+        return False
+
+    return p.stem.lower() not in EXCLUDE_FILE_FROM_LIBS
+
 def include_in_tools(p):
     if p.is_dir() and p.name.lower() in {'scripts', 'i18n', 'pynche', 'demo', 'parser'}:
         return True
@@ -84,6 +99,7 @@
     ('include/', 'include', '*.h', None),
     ('include/', 'PC', 'pyconfig.h', None),
     ('Lib/', 'Lib', '**/*', include_in_lib),
+    ('libs/', 'PCBuild/$arch', '*.lib', include_in_libs),
     ('Tools/', 'Tools', '**/*', include_in_tools),
 ]
 
diff --git a/Tools/nuget/make_pkg.proj b/Tools/nuget/make_pkg.proj
--- a/Tools/nuget/make_pkg.proj
+++ b/Tools/nuget/make_pkg.proj
@@ -17,7 +17,7 @@
         <SignOutput>false</SignOutput>
         <TargetName>$(OutputName).$(NuspecVersion)</TargetName>
         <TargetExt>.nupkg</TargetExt>
-        <TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
+        <TargetPath>$(OutputPath)\$(TargetName)$(TargetExt)</TargetPath>
         <IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)</IntermediateOutputPath>
         
         <CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
@@ -26,10 +26,11 @@
         <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -a $(ArchName)</PythonArguments>
         
         <PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
+        <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>
         
         <NugetArguments>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"</NugetArguments>
         <NugetArguments>$(NugetArguments) -BasePath "$(IntermediateOutputPath)"</NugetArguments>
-        <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath)\en-us"</NugetArguments>
+        <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
         <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
         <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
         
@@ -47,6 +48,7 @@
         <Exec Command="$(Environment)
 $(PythonArguments)" />
         <Exec Command="$(PipArguments)" />
+        <Exec Command="$(PackageArguments)" Condition="$(PackageArguments) != ''" />
         <Exec Command="$(NugetArguments)" />
     </Target>
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list