Skip to content

Commit 919ab1a

Browse files
authored
Appveyor multi builds (#21)
* Build wheels for all python versions in one build on appveyor.
1 parent 261e697 commit 919ab1a

File tree

3 files changed

+26
-42
lines changed

3 files changed

+26
-42
lines changed

.appveyor.yml

+26-38
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,13 @@ environment:
1212
secure: 2m0jy6JD/R9RExIosOT6YA==
1313
PYPI_PASS:
1414
secure: x+dF0A8BZUf2IrPNRN1O0w==
15-
matrix:
16-
- PYTHON: "C:\\Python36-x64"
17-
PYTHON_VERSION: "3.6"
18-
PYTHON_ARCH: "64"
19-
MSVC: "Visual Studio 14 Win64"
20-
ARCH: x64_86
21-
22-
- PYTHON: "C:\\Python37-x64"
23-
PYTHON_VERSION: "3.7"
24-
PYTHON_ARCH: "64"
25-
MSVC: "Visual Studio 14 Win64"
26-
ARCH: x64_86
27-
28-
- PYTHON: "C:\\Python38-x64"
29-
PYTHON_VERSION: "3.8"
30-
PYTHON_ARCH: "64"
31-
MSVC: "Visual Studio 14 Win64"
32-
ARCH: x64_86
15+
# Default python version to run single commands with
16+
PYTHON_DEF: "C:\\Python36-x64"
17+
PYTHON_VERSION: "3.6"
18+
# Python versions to build wheels for
19+
PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64
20+
PYTHON_ARCH: "64"
21+
MSVC: "Visual Studio 14 Win64"
3322

3423
install:
3524
# If there is a newer build queued for the same PR, cancel this one.
@@ -48,51 +37,50 @@ install:
4837
- cp %VCLIBDIR%/msvcr*.dll ssh/
4938
- cp %OPENSSL_DIR%/bin/*.dll ssh/
5039

51-
# Prepend newly installed Python to the PATH of this build (this cannot be
52-
# done from inside the powershell script as it would require to restart
53-
# the parent CMD process).
54-
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
55-
56-
# Check that we have the expected version and architecture for Python
57-
- "python --version"
58-
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
59-
- pip install -U wheel setuptools twine cython
40+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
41+
- for %%I in (%PYTHONVERS%) do %%I\Scripts\pip install -U wheel setuptools twine cython
6042

6143
# .c files need to be generated on Windows to handle platform
6244
# specific code.
6345
# Fix version used by versioneer to current git tag so the generated .c files
6446
# do not cause a version change.
65-
- python ci/appveyor/fix_version.py .
47+
- "%PYTHON_DEF%\\python.exe ci/appveyor/fix_version.py ."
6648
- mv -f .git .git.bak
6749
- 7z x ci\appveyor\zlib1211.zip
68-
# - appveyor DownloadFile https://web.mit.edu/kerberos/dist/kfw/4.1/kfw-4.1-src.zip
69-
# - 7z x kfw-4.1-src.zip
50+
# - appveyor DownloadFile http://web.mit.edu/kerberos/dist/kfw/4.1/kfw-4.1-amd64.msi
51+
# - msiexec /i kfw-4.1-amd64.msi /passive /qn
52+
# - ps: ls "C:\Program Files\MIT\Kerberos\"
53+
# - cp "C:\Program Files\MIT\Kerberos\*.dll" ssh/
7054
- ps: ls ssh
7155
- ps: ls
7256

7357
build_script:
74-
# - ci\\appveyor\\build_krb.bat
7558
- ci\\appveyor\\build_zlib.bat
59+
- for %%I in (%PYTHONVERS%) do cp C:/zlib/lib/zlibstatic.lib %%I/libs/
60+
- for %%I in (%PYTHONVERS%) do ls %%I/libs/
7661
- ci\\appveyor\\build_ssh.bat
7762
- ps: ls src/src/Release
63+
- cp src/src/Release/ssh.dll ssh/
64+
- for %%I in (%PYTHONVERS%) do cp src/src/Release/ssh.lib %%I/libs/
65+
# Clean C files before build
7866
- rm -f ssh/*.c
79-
- python -V
80-
- python setup.py build_ext
81-
- python setup.py build
82-
- python setup.py install
67+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
68+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build_ext
69+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build
70+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py install
8371
- ps: ls ssh
8472

8573
test_script:
8674
- cd dist
87-
- python ..\\ci\\appveyor\\import_test.py
75+
- for %%I in (%PYTHONVERS%) do %%I\python.exe ..\\ci\\appveyor\\import_test.py
8876
- cd ..
8977

9078
after_test:
91-
- python setup.py bdist_wheel
79+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py bdist_wheel
9280
- mv dist/* .
9381

9482
artifacts:
9583
- path: "*.whl"
9684

9785
deploy_script:
98-
- python ci/appveyor/pypi_upload.py *.whl
86+
- "%PYTHON_DEF%\\python.exe ci/appveyor/pypi_upload.py *.whl"

ci/appveyor/build_ssh.bat

-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
1919
cmake --build . --config Release
2020

2121
cd ..
22-
cp src/src/Release/ssh.lib %PYTHON%/libs/
23-
cp src/src/Release/ssh.dll ssh/

ci/appveyor/build_zlib.bat

-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ IF "%MSVC%" == "Visual Studio 9" (
1818
)
1919

2020
cmake --build . --config Release --target install
21-
cp C:/zlib/lib/zlibstatic.lib %PYTHON%/libs/
2221
cd ..
23-
ls %PYTHON%/libs/

0 commit comments

Comments
 (0)