Skip to content

Commit 2b45a0a

Browse files
committed
Refactor AppVeyor builds
1 parent fb679a1 commit 2b45a0a

File tree

2 files changed

+82
-21
lines changed

2 files changed

+82
-21
lines changed

appveyor.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,49 @@ environment:
77

88
matrix:
99
- PYTHON: "C:\\Python27"
10-
PYTHON_VERSION: "2.7.x" # currently 2.7.9
10+
PYTHON_VERSION: "2.7.x"
1111
PYTHON_ARCH: "32"
1212

1313
- PYTHON: "C:\\Python27-x64"
14-
PYTHON_VERSION: "2.7.x" # currently 2.7.9
14+
PYTHON_VERSION: "2.7.x"
1515
PYTHON_ARCH: "64"
1616

1717
- PYTHON: "C:\\Python33"
18-
PYTHON_VERSION: "3.3.x" # currently 3.3.5
18+
PYTHON_VERSION: "3.3.x"
1919
PYTHON_ARCH: "32"
2020

2121
- PYTHON: "C:\\Python33-x64"
22-
PYTHON_VERSION: "3.3.x" # currently 3.3.5
22+
PYTHON_VERSION: "3.3.x"
2323
PYTHON_ARCH: "64"
2424

2525
- PYTHON: "C:\\Python34"
26-
PYTHON_VERSION: "3.4.x" # currently 3.4.3
26+
PYTHON_VERSION: "3.4.x"
2727
PYTHON_ARCH: "32"
2828

2929
- PYTHON: "C:\\Python34-x64"
30-
PYTHON_VERSION: "3.4.x" # currently 3.4.3
30+
PYTHON_VERSION: "3.4.x"
3131
PYTHON_ARCH: "64"
3232

33+
- PYTHON: "C:\\Python35"
34+
PYTHON_VERSION: "3.5.x"
35+
PYTHON_ARCH: "32"
36+
37+
- PYTHON: "C:\\Python35-x64"
38+
PYTHON_VERSION: "3.5.x"
39+
PYTHON_ARCH: "64"
40+
41+
- PYTHON: "C:\\Python36"
42+
PYTHON_VERSION: "3.6.x"
43+
PYTHON_ARCH: "32"
44+
45+
- PYTHON: "C:\\Python36-x64"
46+
PYTHON_VERSION: "3.6.x"
47+
PYTHON_ARCH: "64"
48+
49+
branches:
50+
only:
51+
- master
52+
3353
install:
3454
- ECHO "Filesystem root:"
3555
- ps: "ls \"C:/\""

appveyor/run_with_env.cmd

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
77
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
88
::
9-
:: 32 bit builds do not require specific environment configurations.
9+
:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific
10+
:: environment configurations.
1011
::
1112
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
1213
:: cmd interpreter, at least for (SDK v7.0)
@@ -17,29 +18,69 @@
1718
::
1819
:: Author: Olivier Grisel
1920
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
21+
::
22+
:: Notes about batch files for Python people:
23+
::
24+
:: Quotes in values are literally part of the values:
25+
:: SET FOO="bar"
26+
:: FOO is now five characters long: " b a r "
27+
:: If you don't want quotes, don't include them on the right-hand side.
28+
::
29+
:: The CALL lines at the end of this file look redundant, but if you move them
30+
:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y
31+
:: case, I don't know why.
2032
@ECHO OFF
2133

2234
SET COMMAND_TO_RUN=%*
2335
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
36+
SET WIN_WDK=c:\Program Files (x86)\Windows Kits\10\Include\wdf
37+
38+
:: Extract the major and minor versions, and allow for the minor version to be
39+
:: more than 9. This requires the version number to have two dots in it.
40+
SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1%
41+
IF "%PYTHON_VERSION:~3,1%" == "." (
42+
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
43+
) ELSE (
44+
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2%
45+
)
2446

25-
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
26-
IF %MAJOR_PYTHON_VERSION% == "2" (
47+
:: Based on the Python version, determine what SDK version to use, and whether
48+
:: to set the SDK for 64-bit.
49+
IF %MAJOR_PYTHON_VERSION% == 2 (
2750
SET WINDOWS_SDK_VERSION="v7.0"
28-
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
29-
SET WINDOWS_SDK_VERSION="v7.1"
51+
SET SET_SDK_64=Y
3052
) ELSE (
31-
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
32-
EXIT 1
53+
IF %MAJOR_PYTHON_VERSION% == 3 (
54+
SET WINDOWS_SDK_VERSION="v7.1"
55+
IF %MINOR_PYTHON_VERSION% LEQ 4 (
56+
SET SET_SDK_64=Y
57+
) ELSE (
58+
SET SET_SDK_64=N
59+
IF EXIST "%WIN_WDK%" (
60+
:: See: https://connect.microsoft.com/VisualStudio/feedback/details/1610302/
61+
REN "%WIN_WDK%" 0wdf
62+
)
63+
)
64+
) ELSE (
65+
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
66+
EXIT 1
67+
)
3368
)
3469

35-
IF "%PYTHON_ARCH%"=="64" (
36-
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
37-
SET DISTUTILS_USE_SDK=1
38-
SET MSSdk=1
39-
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
40-
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
41-
ECHO Executing: %COMMAND_TO_RUN%
42-
call %COMMAND_TO_RUN% || EXIT 1
70+
IF %PYTHON_ARCH% == 64 (
71+
IF %SET_SDK_64% == Y (
72+
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
73+
SET DISTUTILS_USE_SDK=1
74+
SET MSSdk=1
75+
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
76+
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
77+
ECHO Executing: %COMMAND_TO_RUN%
78+
call %COMMAND_TO_RUN% || EXIT 1
79+
) ELSE (
80+
ECHO Using default MSVC build environment for 64 bit architecture
81+
ECHO Executing: %COMMAND_TO_RUN%
82+
call %COMMAND_TO_RUN% || EXIT 1
83+
)
4384
) ELSE (
4485
ECHO Using default MSVC build environment for 32 bit architecture
4586
ECHO Executing: %COMMAND_TO_RUN%

0 commit comments

Comments
 (0)