Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 483a322

Browse filesBrowse files
committed
CI: replace the run_with_env.cmd script
I have no idea what is wrong with it and the easiest way would be to replace it with one which is known to work: https://github.com/pelson/Obvious-CI/blob/master/scripts/obvci_appveyor_python_build_env.cmd
1 parent 14fcb76 commit 483a322
Copy full SHA for 483a322

File tree

Expand file treeCollapse file tree

1 file changed

+57
-36
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+57
-36
lines changed

‎ci/appveyor/run_with_env.cmd

Copy file name to clipboardExpand all lines: ci/appveyor/run_with_env.cmd
+57-36Lines changed: 57 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:: EXPECTED ENV VARS: PYTHON_ARCH (either x86 or x64)
2+
:: CONDA_PY (either 27, 33, 35 etc. - only major version is extracted)
3+
::
4+
::
15
:: To build extensions for 64 bit Python 3, we need to configure environment
26
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
37
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
@@ -6,7 +10,8 @@
610
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
711
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
812
::
9-
:: 32 bit builds do not require specific environment configurations.
13+
:: 32 bit builds, and 64-bit builds for 3.5 and beyond, do not require specific
14+
:: environment configurations.
1015
::
1116
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
1217
:: cmd interpreter, at least for (SDK v7.0)
@@ -15,60 +20,76 @@
1520
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
1621
:: http://stackoverflow.com/a/13751649/163740
1722
::
18-
:: Author: Olivier Grisel
23+
:: Author: Phil Elson
24+
:: Original Author: Olivier Grisel (https://github.com/ogrisel/python-appveyor-demo)
1925
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
20-
::@ECHO OFF
26+
::
27+
:: Notes about batch files for Python people:
28+
::
29+
:: Quotes in values are literally part of the values:
30+
:: SET FOO="bar"
31+
:: FOO is now five characters long: " b a r "
32+
:: If you don't want quotes, don't include them on the right-hand side.
33+
::
34+
:: The CALL lines at the end of this file look redundant, but if you move them
35+
:: outside of the IF clauses, they do not run properly in the SET_SDK_64==Y
36+
:: case, I don't know why.
37+
:: originally from https://github.com/pelson/Obvious-CI/blob/master/scripts/obvci_appveyor_python_build_env.cmd
38+
@ECHO OFF
2139

2240
SET COMMAND_TO_RUN=%*
2341
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
2442

25-
:: unquote
26-
call :unquote PYTHON_VERSION %PYTHON_VERSION%
27-
SET MAJOR_PYTHON_VERSION=%PYTHON_VERSION:~0,1%
28-
IF "%PYTHON_VERSION:~1,1%" == "." (
43+
:: Extract the major and minor versions, and allow for the minor version to be
44+
:: more than 9. This requires the version number to have two dots in it.
45+
SET MAJOR_PYTHON_VERSION=%CONDA_PY:~0,1%
46+
47+
IF "%CONDA_PY:~2,1%" == "" (
2948
:: CONDA_PY style, such as 27, 34 etc.
30-
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~1,1%
49+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~1,1%
3150
) ELSE (
32-
IF "%PYTHON_VERSION:~3,1%" == "." (
33-
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
51+
IF "%CONDA_PY:~3,1%" == "." (
52+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,1%
3453
) ELSE (
35-
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,2%
54+
SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,2%
3655
)
3756
)
38-
SET MINOR_PYTHON_VERSION=%PYTHON_VERSION:~2,1%
39-
set USE_MS_SDK=N
57+
58+
:: Based on the Python version, determine what SDK version to use, and whether
59+
:: to set the SDK for 64-bit.
4060
IF %MAJOR_PYTHON_VERSION% == 2 (
41-
SET WINDOWS_SDK_VERSION=v7.0
42-
set USE_MS_SDK=Y
43-
) ELSE IF %MAJOR_PYTHON_VERSION% == 3 (
44-
rem py3.5 does not need a sdk set...
45-
IF %MINOR_PYTHON_VERSION% LEQ 4 (
46-
SET WINDOWS_SDK_VERSION=v7.1
47-
set USE_MS_SDK=Y
48-
)
61+
SET WINDOWS_SDK_VERSION="v7.0"
62+
SET SET_SDK_64=Y
4963
) ELSE (
50-
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
51-
EXIT 1
64+
IF %MAJOR_PYTHON_VERSION% == 3 (
65+
SET WINDOWS_SDK_VERSION="v7.1"
66+
IF %MINOR_PYTHON_VERSION% LEQ 4 (
67+
SET SET_SDK_64=Y
68+
) ELSE (
69+
SET SET_SDK_64=N
70+
)
71+
) ELSE (
72+
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
73+
EXIT /B 1
74+
)
5275
)
5376

54-
SET WINDOWS_SDK_VERSION=%WINDOWS_SDK_VERSION%
55-
IF "%PYTHON_ARCH%"=="64" (
56-
IF "%USE_MS_SDK%" == "N" (
57-
echo Using the happy new world of py35+ auto configuring compilers....
58-
) ELSE (
59-
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION%.%MINOR_PYTHON_VERSION% on a 64 bit architecture
77+
IF "%PYTHON_ARCH%"=="x64" (
78+
IF %SET_SDK_64% == Y (
79+
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
6080
SET DISTUTILS_USE_SDK=1
6181
SET MSSdk=1
6282
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
6383
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
84+
ECHO Executing: %COMMAND_TO_RUN%
85+
call %COMMAND_TO_RUN% || EXIT /B 1
86+
) ELSE (
87+
ECHO Using default MSVC build environment for 64 bit architecture
88+
ECHO Executing: %COMMAND_TO_RUN%
89+
call %COMMAND_TO_RUN% || EXIT /B 1
6490
)
6591
) ELSE (
6692
ECHO Using default MSVC build environment for 32 bit architecture
93+
ECHO Executing: %COMMAND_TO_RUN%
94+
call %COMMAND_TO_RUN% || EXIT /B 1
6795
)
68-
ECHO Executing: %COMMAND_TO_RUN%
69-
call %COMMAND_TO_RUN% || EXIT 1
70-
goto :EOF
71-
72-
:unquote
73-
set %1=%~2
74-
goto :EOF

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.