Skip to content

Commit 7b5f2be

Browse files
authored
Merge pull request #1693 from ales-erjavec/ci-appveyor
[ENH] Add appveyor configuration
2 parents 92bba3f + f14d388 commit 7b5f2be

File tree

12 files changed

+507
-129
lines changed

12 files changed

+507
-129
lines changed

.ci_tools/appveyor/build.cmd

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@echo off
2+
:: To build extensions for 64 bit Python 3, we need to configure environment
3+
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
4+
:: MS Windows SDK for Windows 7 and .NET Framework 4
5+
::
6+
:: More details at:
7+
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
8+
9+
IF "%DISTUTILS_USE_SDK%"=="1" (
10+
ECHO Configuring environment to build with MSVC on a 64bit architecture
11+
ECHO Using Windows SDK 7.1
12+
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe" -q -version:v7.1
13+
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release
14+
SET MSSdk=1
15+
REM Need the following to allow tox to see the SDK compiler
16+
SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
17+
) ELSE (
18+
ECHO Using default MSVC build environment
19+
)
20+
21+
CALL %*

.ci_tools/appveyor/step-build.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
if (Test-Path dist) {
3+
Remove-Item -Recurse -Force dist
4+
}
5+
6+
python setup.py clean --all
7+
8+
cmd.exe /c @"
9+
.ci_tools\appveyor\build.cmd python setup.py $env:BUILD_GLOBAL_OPTIONS bdist_wheel --dist-dir dist
10+
"@
11+
12+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Install build requirements
2+
3+
python -m ensurepip
4+
python -m pip install pip==8.1.* wheel==0.29.*
5+
6+
python -m pip install `
7+
--extra-index-url $env:STAGING_INDEX `
8+
--only-binary numpy `
9+
numpy==$env:NUMPY_BUILD_VERSION
10+
11+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
echo "Building and testing using conda in: $env:MINICONDA"
3+
echo ""
4+
5+
if (-not($env:MINICONDA)) { throw "MINICONDA env variable must be defined" }
6+
7+
$python = "$env:MINICONDA\python"
8+
$conda = "$env:MINICONDA\Scripts\conda"
9+
10+
# Need at least conda 4.1.0 (channel priorities)
11+
12+
& "$conda" install --yes "conda>=4.1.0"
13+
14+
# add conda-forge channel
15+
& "$conda" config --append channels conda-forge
16+
17+
# some required packages that are not on conda-forge
18+
& "$conda" config --append channels ales-erjavec
19+
20+
& "$conda" install --yes conda-build
21+
22+
echo "Conda info"
23+
echo "----------"
24+
& "$conda" info
25+
echo ""
26+
27+
echo "Starting conda build"
28+
echo "--------------------"
29+
& "$conda" build conda-recipe
30+
31+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
32+
33+
# also copy build conda pacakge to build artifacts
34+
echo "copying conda package to dist/conda"
35+
echo "-----------------------------------"
36+
37+
$pkgpath = & "$conda" build --output conda-recipe
38+
mkdir -force dist/conda | out-null
39+
cp "$pkgpath" dist/conda/

.ci_tools/appveyor/step-test.ps1

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
2+
echo "Setting up a testing env in $env:USERPROFILE\testenv"
3+
4+
python -m venv --clear $env:USERPROFILE\testenv
5+
6+
& $env:USERPROFILE\testenv\Scripts\Activate.ps1
7+
8+
$version = python setup.py --version
9+
10+
python -c 'import sys; print(\"sys.prefix:\", sys.prefix); print(sys.version)'
11+
python -m pip install pip==8.1.* wheel==0.29.*
12+
13+
# run install and test from a empty dir to avoid imports from current dir
14+
15+
mkdir -force build/testdir | out-null
16+
pushd
17+
18+
try {
19+
cd build/testdir
20+
21+
# Install numpy/scipy from staging index (contains numpy and scipy
22+
# extracted form the legacy superpack installers (sse2 builds))
23+
24+
python -m pip install `
25+
--index-url "$env:STAGING_INDEX" `
26+
--only-binary "numpy,scipy" numpy scipy
27+
28+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
29+
30+
31+
# Install specific Orange3 version
32+
python -m pip install --no-deps --no-index `
33+
--find-links ../../dist `
34+
Orange3==$version
35+
36+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
37+
38+
# Instal other remaining dependencies
39+
python -m pip install `
40+
--extra-index-url "$env:STAGING_INDEX" `
41+
--only-binary "numpy,scipy" `
42+
Orange3==$version
43+
44+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
45+
46+
echo "Test environment:"
47+
echo "-----------------"
48+
python -m pip freeze
49+
echo "-----------------"
50+
51+
# Run core tests
52+
echo "Running tests"
53+
echo "-------------"
54+
python -m unittest -v Orange.tests
55+
56+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
57+
58+
# Widget tests
59+
python -m pip install `
60+
--extra-index-url "$Env:STAGING_INDEX" `
61+
PyQt5
62+
63+
echo "Running widget tests with PyQt5"
64+
echo "-------------------------------"
65+
try {
66+
$Env:ANYQT_HOOK_BACKPORT = "pyqt4"
67+
python -m unittest -v Orange.widgets.tests
68+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
69+
} finally {
70+
$Env:ANYQT_HOOK_BACKPORT = ""
71+
}
72+
73+
python -m pip uninstall --yes PyQt5
74+
python -m pip install `
75+
--extra-index-url "$Env:STAGING_INDEX" `
76+
PyQt4
77+
78+
echo "Running widget tests with PyQt4"
79+
echo "-------------------------------"
80+
81+
python -m unittest -v Orange.widgets.tests
82+
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
83+
84+
} finally {
85+
popd
86+
}

0 commit comments

Comments
 (0)