This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.appveyor.yml
104 lines (91 loc) · 3.87 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
version: 1.2.3-{build}-{branch}
image: Visual Studio 2017
init:
- choco install wget checksum
environment:
global:
PYTHON: C:\Miniconda36-x64
PYTHON_ARCH: "64"
PACKAGE_NAME: "cvxopt"
BUILD_DEPENDS: "mkl==2018.0.3"
TEST_DEPENDS: "pytest"
CVXOPT_BLAS_LIB: mkl_rt
CVXOPT_LAPACK_LIB: mkl_rt
CVXOPT_BUILD_GLPK: "1"
CVXOPT_INSTALL_REQUIRES: mkl
GLPK_VERSION: "4.65"
GLPK_SHA256: "4281e29b628864dfe48d393a7bedd781e5b475387c20d8b0158f329994721a10"
SUITESPARSE_VERSION: "5.3.0"
SUITESPARSE_SHA256: "90e69713d8c454da5a95a839aea5d97d8d03d00cc1f667c4bdfca03f640f963d"
matrix:
- PYTHON_VERSION: 3.7
CVXOPT_MSVC: 1
- PYTHON_VERSION: 3.6
CVXOPT_MSVC: 1
- PYTHON_VERSION: 3.5
CVXOPT_MSVC: 1
- PYTHON_VERSION: 2.7
COMPILER: mingwpy
platform:
- x64
install:
- if [%PYTHON_ARCH%]==[64] (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
) else (
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
)
# Set up miniconda build environment
- SET "PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%ProgramFiles%\7-Zip;%PATH%"
- conda info
- conda create --yes -n build_env python=%PYTHON_VERSION% %BUILD_DEPENDS%
- activate build_env
- if [%COMPILER%]==[mingwpy] ( pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy )
- SET CVXOPT_BLAS_LIB_DIR=%PYTHON%\envs\build_env\Library\lib
# Download SuiteSparse and set CVXOPT_SUITESPARSE_SRC_DIR
- wget -nv http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-%SUITESPARSE_VERSION%.tar.gz
- checksum -t sha256 -c %SUITESPARSE_SHA256% SuiteSparse-%SUITESPARSE_VERSION%.tar.gz
- 7z x -bso0 -bsp0 SuiteSparse-%SUITESPARSE_VERSION%.tar.gz && 7z x -bso0 -bsp0 SuiteSparse-%SUITESPARSE_VERSION%.tar
- SET CVXOPT_SUITESPARSE_SRC_DIR=%cd%\SuiteSparse
# Download and build GLPK
- if [%CVXOPT_BUILD_GLPK%]==[1] (
if [%CVXOPT_MSVC%]==[1] (
wget -nv http://ftp.gnu.org/gnu/glpk/glpk-%GLPK_VERSION%.tar.gz &&
checksum -t sha256 -c %GLPK_SHA256% glpk-%GLPK_VERSION%.tar.gz &&
7z x -bso0 -bsp0 glpk-%GLPK_VERSION%.tar.gz && 7z x -bso0 -bsp0 glpk-%GLPK_VERSION%.tar &&
cd glpk-%GLPK_VERSION%\w64 &&
copy config_VC config.h &&
nmake /f Makefile_VC glpk.lib &&
cd ..\.. &&
SET "CVXOPT_GLPK_LIB_DIR=%cd%\glpk-%GLPK_VERSION%\w64" &&
SET "CVXOPT_GLPK_INC_DIR=%cd%\glpk-%GLPK_VERSION%\src"
) else (
appveyor AddMessage "Disabled GLPK extension" -Category Warning &&
SET "CVXOPT_BUILD_GLPK=0"
)
)
# Check that we have the expected version and architecture for Python
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
build_script:
# Build wheel
- if [%COMPILER%]==[mingwpy] ( python setup.py build --compiler=mingw32 )
else ( python setup.py build --compiler=msvc )
- python setup.py bdist_wheel
- ls dist/*
test_script:
# Create test env
- conda create --yes -n test_env python=%PYTHON_VERSION% %TEST_DEPENDS%
- activate test_env
# Install from wheel
- pip install %CVXOPT_INSTALL_REQUIRES%
- pip install --no-index --find-links dist/ %PACKAGE_NAME%
# Run tests
- python --version
- python -c "from cvxopt import blas,lapack,cholmod,umfpack"
- if [%CVXOPT_BUILD_DSDP%]==[1] ( python -c "from cvxopt import dsdp" )
- if [%CVXOPT_BUILD_FFTW%]==[1] ( python -c "from cvxopt import fftw" )
- if [%CVXOPT_BUILD_GLPK%]==[1] ( python -c "from cvxopt import glpk" )
- if [%CVXOPT_BUILD_GSL%]==[1] ( python -c "from cvxopt import gsl" )
- pytest
artifacts:
- path: dist/*.whl