Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06606e7

Browse files
committed
Ignore user environment/site-packages for ensurepip and compile_all
Remove build condition to prevent old strings hanging around Add -h option to build.bat
1 parent 1b7f6fe commit 06606e7

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

Tools/msi/build.bat

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ set BUILDX64=
88
set BUILDDOC=
99

1010
:CheckOpts
11-
if '%1'=='-x86' (set BUILDX86=1) && shift && goto CheckOpts
12-
if '%1'=='-x64' (set BUILDX64=1) && shift && goto CheckOpts
13-
if '%1'=='--doc' (set BUILDDOC=1) && shift && goto CheckOpts
11+
if "%1" EQU "-h" goto Help
12+
if "%1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
13+
if "%1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
14+
if "%1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
1415

1516
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
1617

@@ -44,3 +45,12 @@ if defined BUILDX64 (
4445
msbuild "%D%bundle\snapshot.wixproj" /p:Platform=x64
4546
if errorlevel 1 goto :eof
4647
)
48+
49+
exit /B 0
50+
51+
:Help
52+
echo build.bat [-x86] [-x64] [--doc] [-h]
53+
echo.
54+
echo -x86 Build x86 installers
55+
echo -x64 Build x64 installers
56+
echo --doc Build CHM documentation

Tools/msi/bundle/packagegroups/postinstall.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
3737
</MsiPackage>
3838

39-
<?define CompileAllCommand=-$(var.ShortVersion)$(var.Suffix32) -Wi "[TargetDir]\Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests|venv\\scripts" "[TargetDir]\Lib"?>
39+
<?define CompileAllCommand=-$(var.ShortVersion)$(var.Suffix32) -E -s -Wi "[TargetDir]\Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests|venv\\scripts" "[TargetDir]\Lib"?>
4040
<ExePackage Id="compileall_AllUsers"
4141
SourceFile="py.exe"
4242
Compressed="yes"

Tools/msi/msi.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</ItemGroup>
2525
</Target>
2626

27-
<Target Name="_TransformWxlTemplates" AfterTargets="PrepareForBuild" Inputs="@(WxlTemplate)" Outputs="$(IntermediateOutputPath)%(Filename).wxl">
27+
<Target Name="_TransformWxlTemplates" AfterTargets="PrepareForBuild">
2828
<PropertyGroup>
2929
<_Content>$([System.IO.File]::ReadAllText(%(WxlTemplate.FullPath)).Replace(`{{ShortVersion}}`, `$(MajorVersionNumber).$(MinorVersionNumber)`).Replace(`{{LongVersion}}`, `$(PythonVersion)`).Replace(`{{Bitness}}`, `$(Bitness)`))</_Content>
3030
<_ExistingContent Condition="Exists('$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl')">$([System.IO.File]::ReadAllText($(IntermediateOutputPath)%(WxlTemplate.Filename).wxl))</_ExistingContent>

Tools/msi/pip/pip.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<?endif ?>
2828

2929
<!-- Install/uninstall pip -->
30-
<CustomAction Id="SetUpdatePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -m ensurepip -U --default-pip' Execute="immediate" />
31-
<CustomAction Id="SetRemovePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -B -m ensurepip._uninstall' Execute="immediate" />
30+
<CustomAction Id="SetUpdatePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -E -s -m ensurepip -U --default-pip' Execute="immediate" />
31+
<CustomAction Id="SetRemovePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -E -s -B -m ensurepip._uninstall' Execute="immediate" />
3232

3333
<InstallExecuteSequence>
3434
<Custom Action="SetUpdatePipCommandLine" Before="UpdatePip">(&amp;DefaultFeature=3) AND NOT (!DefaultFeature=3)</Custom>

0 commit comments

Comments
 (0)