From: Steve Dower Date: Tue, 22 Sep 2015 22:03:54 +0000 (-0700) Subject: Closes #25085 and #25086: Exclude distutils and test directories from embeddable... X-Git-Tag: v3.5.1rc1~299 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2495faf8fcbe07ff5a6f422d002a9e39d7eb9e0a;p=python Closes #25085 and #25086: Exclude distutils and test directories from embeddable distro. --- diff --git a/Tools/msi/make_zip.proj b/Tools/msi/make_zip.proj index 766fe8597c..d2e031f6b6 100644 --- a/Tools/msi/make_zip.proj +++ b/Tools/msi/make_zip.proj @@ -14,6 +14,7 @@ python-$(PythonVersion)-embed-$(ArchName) .zip $(OutputPath)\en-us\$(TargetName)$(TargetExt) + rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)" "$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py" $(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a $(ArchName) set DOC_FILENAME=python$(PythonVersion).chm @@ -23,6 +24,7 @@ set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140. diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py index c256008aca..96fdad2197 100644 --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -15,6 +15,20 @@ TKTCL_RE = re.compile(r'^(_?tk|tcl).+\.(pyd|dll)', re.IGNORECASE) DEBUG_RE = re.compile(r'_d\.(pyd|dll|exe)$', re.IGNORECASE) PYTHON_DLL_RE = re.compile(r'python\d\d?\.dll$', re.IGNORECASE) +EXCLUDE_FROM_LIBRARY = { + '__pycache__', + 'ensurepip', + 'idlelib', + 'pydoc_data', + 'site-packages', + 'tkinter', + 'turtledemo', +} + +EXCLUDE_FILE_FROM_LIBRARY = { + 'bdist_wininst.py', +} + def is_not_debug(p): if DEBUG_RE.search(p.name): return False @@ -37,16 +51,21 @@ def is_not_debug_or_python(p): def include_in_lib(p): name = p.name.lower() if p.is_dir(): - if name in {'__pycache__', 'ensurepip', 'idlelib', 'pydoc_data', 'tkinter', 'turtledemo'}: + if name in EXCLUDE_FROM_LIBRARY: return False if name.startswith('plat-'): return False if name == 'test' and p.parts[-2].lower() == 'lib': return False + if name in {'test', 'tests'} and p.parts[-3].lower() == 'lib': + return False return True + if name in EXCLUDE_FILE_FROM_LIBRARY: + return False + suffix = p.suffix.lower() - return suffix not in {'.pyc', '.pyo'} + return suffix not in {'.pyc', '.pyo', '.exe'} def include_in_tools(p): if p.is_dir() and p.name.lower() in {'scripts', 'i18n', 'pynche', 'demo', 'parser'}: