Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
multibuild
Commits
a192879e
Unverified
Commit
a192879e
authored
Jan 13, 2018
by
xoviat
Committed by
GitHub
Jan 13, 2018
Browse files
Merge pull request #118 from native-api/miniconda_36
Appveyor build environment hacks are no longer needed
parents
a7b7a159
627c78d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
226 deletions
+1
-226
appveyor.yml
appveyor.yml
+1
-10
ci/appveyor/install.ps1
ci/appveyor/install.ps1
+0
-96
ci/appveyor/missing-headers.ps1
ci/appveyor/missing-headers.ps1
+0
-54
ci/appveyor/windows_sdk.cmd
ci/appveyor/windows_sdk.cmd
+0
-66
No files found.
appveyor.yml
View file @
a192879e
...
...
@@ -6,11 +6,6 @@ environment:
BUILD_DEPENDS
:
"
cython"
TEST_DEPENDS
:
"
nose"
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script interpreter
# See: https://stackoverflow.com/a/13751649/163740
CMD_IN_ENV
:
"
cmd
/E:ON
/V:ON
/C
%APPVEYOR_BUILD_FOLDER%
\\
ci
\\
appveyor
\\
windows_sdk.cmd"
matrix
:
-
PYTHON
:
"
C:
\\
Miniconda"
PYTHON_VERSION
:
"
2.7"
...
...
@@ -49,13 +44,9 @@ platform:
matrix
:
fast_finish
:
true
allow_failures
:
-
PYTHON_VERSION
:
"
3.4"
install
:
# Install miniconda and fix headers
-
ps
:
.\\ci\\appveyor\\install.ps1
-
ps
:
.\\ci\\appveyor\\missing-headers.ps1
-
SET PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%PATH%
-
conda info
...
...
@@ -75,7 +66,7 @@ build_script:
# build wheel:
-
cd %REPO_DIR%
-
git checkout %BUILD_COMMIT%
-
"
%CMD_IN_ENV%
python
setup.py
bdist_wheel
"
-
python setup.py bdist_wheel
-
ls dist/*
test_script
:
...
...
ci/appveyor/install.ps1
deleted
100644 → 0
View file @
a7b7a159
# Sample script to install Miniconda under Windows
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner, Robert McGibbon
# License: CC0 1.0 Universal: https://creativecommons.org/publicdomain/zero/1.0/
$MINICONDA_URL
=
"http://repo.continuum.io/miniconda/"
function
DownloadMiniconda
(
$python_version
,
$platform_suffix
)
{
$webclient
=
New-Object
System.Net.WebClient
if
(
$python_version
-gt
"3"
)
{
$filename
=
"Miniconda3-latest-Windows-"
+
$platform_suffix
+
".exe"
}
else
{
$filename
=
"Miniconda2-latest-Windows-"
+
$platform_suffix
+
".exe"
}
$url
=
$MINICONDA_URL
+
$filename
$basedir
=
$pwd
.
Path
+
"\"
$filepath
=
$basedir
+
$filename
if
(
Test-Path
$filename
)
{
Write-Host
"Reusing"
$filepath
return
$filepath
}
# Download and retry up to 3 times in case of network transient errors.
Write-Host
"Downloading"
$filename
"from"
$url
$retry_attempts
=
2
for
(
$i
=
0
;
$i
-lt
$retry_attempts
;
$i
++
){
try
{
$webclient
.
DownloadFile
(
$url
,
$filepath
)
break
}
Catch
[
Exception
]{
Start-Sleep
1
}
}
if
(
Test-Path
$filepath
)
{
Write-Host
"File saved at"
$filepath
}
else
{
# Retry once to get the error message if any at the last try
$webclient
.
DownloadFile
(
$url
,
$filepath
)
}
return
$filepath
}
function
InstallMiniconda
(
$python_version
,
$architecture
,
$python_home
)
{
Write-Host
"Installing Python"
$python_version
"for"
$architecture
"bit architecture to"
$python_home
if
(
Test-Path
$python_home
)
{
Write-Host
$python_home
"already exists, skipping."
return
$false
}
if
(
$architecture
-match
"32"
)
{
$platform_suffix
=
"x86"
}
else
{
$platform_suffix
=
"x86_64"
}
$filepath
=
DownloadMiniconda
$python_version
$platform_suffix
Write-Host
"Installing"
$filepath
"to"
$python_home
$install_log
=
$python_home
+
".log"
$args
=
"/S /D=
$python_home
"
Write-Host
$filepath
$args
Start-Process
-FilePath
$filepath
-ArgumentList
$args
-Wait
-Passthru
if
(
Test-Path
$python_home
)
{
Write-Host
"Python
$python_version
(
$architecture
) installation complete"
}
else
{
Write-Host
"Failed to install Python in
$python_home
"
Get-Content
-Path
$install_log
Exit
1
}
}
function
InstallCondaPackages
(
$python_home
,
$spec
)
{
$conda_path
=
$python_home
+
"\Scripts\conda.exe"
$args
=
"install --yes "
+
$spec
Write-Host
(
"conda "
+
$args
)
Start-Process
-FilePath
"
$conda_path
"
-ArgumentList
$args
-Wait
-Passthru
}
function
UpdateConda
(
$python_home
)
{
$conda_path
=
$python_home
+
"\Scripts\conda.exe"
Write-Host
"Updating conda..."
$args
=
"update --yes conda"
Write-Host
$conda_path
$args
Start-Process
-FilePath
"
$conda_path
"
-ArgumentList
$args
-Wait
-Passthru
}
function
main
()
{
InstallMiniconda
$
env
:
PYTHON_VERSION
$
env
:
PYTHON_ARCH
$
env
:
PYTHON
UpdateConda
$
env
:
PYTHON
InstallCondaPackages
$
env
:
PYTHON
"conda-build=1.4.0 pip jinja2 binstar"
}
main
ci/appveyor/missing-headers.ps1
deleted
100644 → 0
View file @
a7b7a159
function
InstallMissingHeaders
()
{
# Visual Studio 2008 is missing stdint.h, but you can just download one
# from the web.
# https://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio
$webclient
=
New-Object
System.Net.WebClient
$include_dirs
=
@(
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
,
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"
,
"C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include"
,
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include"
,
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
)
Foreach
(
$include_dir
in
$include_dirs
)
{
$urls
=
@(@(
"https://raw.githubusercontent.com/chemeris/msinttypes/master/stdint.h"
,
"stdint.h"
),
@(
"https://raw.githubusercontent.com/chemeris/msinttypes/master/inttypes.h"
,
"inttypes.h"
))
Foreach
(
$i
in
$urls
)
{
$url
=
$i
[
0
]
$filename
=
$i
[
1
]
$filepath
=
"
$include_dir
\
$filename
"
if
(
Test-Path
$filepath
)
{
Write-Host
$filename
"already exists in"
$include_dir
continue
}
Write-Host
"Downloading remedial "
$filename
" from"
$url
"to"
$filepath
$retry_attempts
=
2
for
(
$i
=
0
;
$i
-lt
$retry_attempts
;
$i
++
){
try
{
$webclient
.
DownloadFile
(
$url
,
$filepath
)
break
}
Catch
[
Exception
]{
Start-Sleep
1
}
}
if
(
Test-Path
$filepath
)
{
Write-Host
"File saved at"
$filepath
}
else
{
# Retry once to get the error message if any at the last try
$webclient
.
DownloadFile
(
$url
,
$filepath
)
}
}
}
}
function
main
()
{
InstallMissingHeaders
}
main
ci/appveyor/windows_sdk.cmd
deleted
100644 → 0
View file @
a7b7a159
:: To build extensions for 64 bit Python 3.5 or later no special environment needs
:: to be configured.
::
:: To build extensions for 64 bit Python 3.4 or earlier, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
::
:: To build extensions for 64 bit Python 2, we need to configure environment
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
::
:: 32 bit builds do not require specific environment configurations.
::
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/CythonExtensionsOnWindows
:: https://stackoverflow.com/a/13751649/163740
::
:: Original Author: Olivier Grisel
:: License: CC0 1.0 Universal: https://creativecommons.org/publicdomain/zero/1.0/
:: This version based on updates for python 3.5 by Phil Elson at:
:: https://github.com/pelson/Obvious-CI/tree/master/scripts
@ECHO
OFF
SET
COMMAND_TO_RUN
=
%
*
SET
WIN_SDK_ROOT
=
C
:\Program
Files
\Microsoft
SDKs
\Windows
SET
MAJOR_PYTHON_VERSION
=
"
%PYTHON
_VERSION:~0,1
%
"
SET
MINOR_PYTHON_VERSION
=
%PYTHON
_VERSION:
~
2
,
1
%
IF
%MAJOR_PYTHON_VERSION%
==
"2"
(
SET
WINDOWS_SDK_VERSION
=
"v7.0"
SET
SET_SDK_64
=
Y
)
ELSE
IF
%MAJOR_PYTHON_VERSION%
==
"3"
(
SET
WINDOWS_SDK_VERSION
=
"v7.1"
IF
%MINOR_PYTHON_VERSION%
LEQ
4
(
SET
SET_SDK_64
=
Y
)
ELSE
(
SET
SET_SDK_64
=
N
)
)
ELSE
(
ECHO
Unsupported
Python
version
:
"
%MAJOR_PYTHON_VERSION%
"
EXIT
1
)
IF
"
%PYTHON_ARCH%
"
==
"64"
(
IF
%SET
_SDK_64
%
==
Y
(
ECHO
Configuring
Windows
SDK
%WINDOWS_SDK_VERSION%
for
Python
%MAJOR_PYTHON_VERSION%
on
a
64
bit
architecture
SET
DISTUTILS_USE_SDK
=
1
SET
MSSdk
=
1
"
%WIN_SDK_ROOT%
\
%WINDOWS_SDK_VERSION%
\Setup\WindowsSdkVer.exe"
-q -version
:
%WINDOWS_SDK_VERSION%
"
%WIN_SDK_ROOT%
\
%WINDOWS_SDK_VERSION%
\Bin\SetEnv.cmd"
/x
64
/release
ECHO
Executing
:
%COMMAND_TO_RUN%
call
%COMMAND_TO_RUN%
||
EXIT
1
)
ELSE
(
ECHO
Using
default
MSVC
build
environment
for
64
bit
architecture
ECHO
Executing
:
%COMMAND_TO_RUN%
call
%COMMAND_TO_RUN%
||
EXIT
1
)
)
ELSE
(
ECHO
Using
default
MSVC
build
environment
for
32
bit
architecture
ECHO
Executing
:
%COMMAND_TO_RUN%
call
%COMMAND_TO_RUN%
||
EXIT
1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment