mirror of
https://github.com/python/cpython
synced 2026-09-29 11:35:29 +03:00
Improves handling of test markers for building Python without intefering with actual installs.
This commit is contained in:
parent
f97edf1aa6
commit
940f6a8f11
13 changed files with 93 additions and 63 deletions
|
|
@ -38,6 +38,7 @@ echo. -p x64 ^| Win32
|
|||
echo. Set the platform (default: Win32)
|
||||
echo. -t Build ^| Rebuild ^| Clean ^| CleanAll
|
||||
echo. Set the target manually
|
||||
echo. --test-marker Enable the test marker within the build.
|
||||
exit /b 127
|
||||
|
||||
:Run
|
||||
|
|
@ -62,6 +63,7 @@ if "%~1"=="-m" (set parallel=/m) & shift & goto CheckOpts
|
|||
if "%~1"=="-M" (set parallel=) & shift & goto CheckOpts
|
||||
if "%~1"=="-v" (set verbose=/v:n) & shift & goto CheckOpts
|
||||
if "%~1"=="-k" (set kill=true) & shift & goto CheckOpts
|
||||
if "%~1"=="--test-marker" (set UseTestMarker=true) & shift & goto CheckOpts
|
||||
if "%~1"=="-V" shift & goto Version
|
||||
rem These use the actual property names used by MSBuild. We could just let
|
||||
rem them in through the environment, but we specify them on the command line
|
||||
|
|
@ -93,6 +95,7 @@ msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^
|
|||
/p:Configuration=%conf% /p:Platform=%platf%^
|
||||
/p:IncludeExternals=%IncludeExternals%^
|
||||
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^
|
||||
/p:UseTestMarker=%UseTestMarker%^
|
||||
%1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
||||
@goto :eof
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
|
|||
</UsingTask>
|
||||
|
||||
<Target Name="KillPython" BeforeTargets="PrepareForBuild" Condition="'$(KillPython)' == 'true'">
|
||||
<Message Text="Killing any running python.exe instances..." Importance="high" />
|
||||
<KillPython FileName="$(OutDir)python$(PyDebugExt).exe" />
|
||||
<Message Text="Killing any running python$(PyDebugExt)$(PyTestExt).exe instances..." Importance="high" />
|
||||
<KillPython FileName="$(OutDir)python$(PyDebugExt)$(PyTestExt).exe" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
|
|
|
|||
|
|
@ -41,6 +41,12 @@
|
|||
<!-- Suffix for all binaries when building for debug -->
|
||||
<PyDebugExt Condition="'$(PyDebugExt)' == '' and $(Configuration) == 'Debug'">_d</PyDebugExt>
|
||||
|
||||
<!-- Suffix for versions/keys when building with test markers -->
|
||||
<PyTestExt Condition="$(UseTestMarker) == 'true'">-test</PyTestExt>
|
||||
|
||||
<!-- Suffix for versions/keys when building for particular platforms -->
|
||||
<PyArchExt Condition="'$(ArchName)' == 'win32'">-32</PyArchExt>
|
||||
|
||||
<!-- Full path of the resulting python.exe binary -->
|
||||
<PythonExe Condition="'$(PythonExe)' == ''">$(BuildPath)python$(PyDebugExt).exe</PythonExe>
|
||||
</PropertyGroup>
|
||||
|
|
@ -129,17 +135,17 @@
|
|||
$([msbuild]::Multiply($(MicroVersionNumber), 1000))
|
||||
))
|
||||
))</Field3Value>
|
||||
<Field3Value Condition="$(UseTestMarker) == 'true'">$([msbuild]::Add($(Field3Value), 9000))</Field3Value>
|
||||
|
||||
<!-- The name of the resulting pythonXY.dll (without the extension) -->
|
||||
<PyDllName>python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt)</PyDllName>
|
||||
|
||||
<!-- The version and platform tag to include in .pyd filenames -->
|
||||
<PydTag Condition="$(Platform) == 'Win32' or $(Platform) == 'x86'">.cp$(MajorVersionNumber)$(MinorVersionNumber)-win32</PydTag>
|
||||
<PydTag Condition="$(Platform) == 'x64'">.cp$(MajorVersionNumber)$(MinorVersionNumber)-win_amd64</PydTag>
|
||||
<PydTag Condition="$(ArchName) == 'win32'">.cp$(MajorVersionNumber)$(MinorVersionNumber)-win32</PydTag>
|
||||
<PydTag Condition="$(ArchName) == 'amd64'">.cp$(MajorVersionNumber)$(MinorVersionNumber)-win_amd64</PydTag>
|
||||
|
||||
<!-- The version number for sys.winver -->
|
||||
<SysWinVer>$(MajorVersionNumber).$(MinorVersionNumber)</SysWinVer>
|
||||
<SysWinVer Condition="$(Platform) == 'Win32' or $(Platform) == 'x86'">$(SysWinVer)-32</SysWinVer>
|
||||
<SysWinVer>$(MajorVersionNumber).$(MinorVersionNumber)$(PyArchExt)$(PyTestExt)</SysWinVer>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Displays the calculated version info -->
|
||||
|
|
@ -148,5 +154,7 @@
|
|||
<Message Importance="high" Text="PythonVersion: $(PythonVersion)" />
|
||||
<Message Importance="high" Text="PythonVersionHex: 0x$([System.UInt32]::Parse($(PythonVersionHex)).ToString(`X08`))" />
|
||||
<Message Importance="high" Text="Field3Value: $(Field3Value)" />
|
||||
<Message Importance="high" Text="SysWinVer: $(SysWinVer)" />
|
||||
<Message Importance="high" Text="PyDllName: $(PyDllName)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue