Skip to content

Commit 2bf0b13

Browse files
authored
Appveyor multi build (#110)
* Single appveyor build for all python versions * Updated appveyor cfg
1 parent 44d5617 commit 2bf0b13

File tree

4 files changed

+28
-44
lines changed

4 files changed

+28
-44
lines changed

.appveyor.yml

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,23 @@ build:
33
parallel: true
44
verbosity: minimal
55
skip_branch_with_pr: true
6+
67
environment:
78
global:
89
PYTHONUNBUFFERED: 1
910
EMBEDDED_LIB: 1
1011
SYSTEM_LIBSSH2: 1
1112
PYPI_USER:
12-
secure: 2m0jy6JD/R9RExIosOT6YA==
13+
secure: WKF8ok0UPIgkA+isDUuHww==
1314
PYPI_PASS:
14-
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+
secure: uXkrTaPGSNQdXTJIt3aiyyGnH/ZtvWbDVIXdMrsgwROIJ0kprWp5crS6TAqqddyrFxd7Trrfjg/TjM1/Yx9JzfuKTfoJh1zyviWD/j2zibsycmJQy4Q+CrZ6uI3IRQwe/2ILKxGzLGFBWaqt6C8NaQnkKP+h7ptnPeVhy1+kaOaJowwrCKWje1Ag3CJCAJxPjSC8yl1nlM3DA1rAIk2C5SR4eQQLJeEpPSg3nDnxR4o4YjmA7ILD3OuM1Fbh5iue/rUvWzdt6QCxCbE4egtrCQ==
16+
# Default python version to run single commands with
17+
PYTHON_DEF: "C:\\Python36-x64"
18+
PYTHON_VERSION: "3.6"
19+
# Python versions to build wheels for
20+
PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64
21+
PYTHON_ARCH: "64"
22+
MSVC: "Visual Studio 14 Win64"
3323

3424
install:
3525
# If there is a newer build queued for the same PR, cancel this one.
@@ -48,49 +38,44 @@ install:
4838
- cp %VCLIBDIR%/msvcr*.dll ssh2/
4939
- cp %OPENSSL_DIR%/bin/*.dll ssh2/
5040

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-
60-
- pip install -U wheel setuptools twine cython
41+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
42+
- for %%I in (%PYTHONVERS%) do %%I\Scripts\pip install -U wheel setuptools twine cython
6143

6244
# .c files need to be generated on Windows to handle platform
6345
# specific code.
6446
# Fix version used by versioneer to current git tag so the generated .c files
6547
# do not cause a version change.
66-
- python ci/appveyor/fix_version.py .
48+
- "%PYTHON_DEF%\\python.exe ci/appveyor/fix_version.py ."
6749
- mv -f .git .git.bak
6850
- 7z x ci\appveyor\zlib1211.zip
6951
- ps: ls ssh2
7052

7153
build_script:
7254
- ci\\appveyor\\build_zlib.bat
55+
- for %%I in (%PYTHONVERS%) do cp C:/zlib/lib/zlibstatic.lib %%I/libs/
56+
- for %%I in (%PYTHONVERS%) do ls %%I/libs/
7357
- ci\\appveyor\\build_ssh2.bat
58+
- for %%I in (%PYTHONVERS%) do cp src/src/libssh2.lib %%I/libs/ || cp src/src/Release/libssh2.lib %%I/libs/
7459
- rm -f ssh2/*.c
75-
- python -V
76-
- python setup.py build_ext -I libssh2/include
77-
- python setup.py build
78-
- python setup.py install
60+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
61+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build_ext
62+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build
63+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py install
7964
- ps: ls ssh2
8065

8166
test_script:
8267
- cd dist
83-
- python -c "from ssh2.session import Session; Session()"
68+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -c "from ssh2.session import Session; Session()"
8469
- cd ..
8570

8671
after_test:
87-
# If tests are successful, create binary packages for the project.
88-
- python setup.py bdist_wheel
72+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py bdist_wheel
8973
- mv dist/* .
9074

9175
artifacts:
92-
# Archive the generated packages in the ci.appveyor.com build report.
9376
- path: "*.whl"
9477

9578
deploy_script:
79+
# Calling twine requires we set path
80+
- "SET PATH=%PYTHON_DEF%;%PYTHON_DEF%\\Scripts;%PATH%"
9681
- python ci/appveyor/pypi_upload.py *.whl

ci/appveyor/build_ssh2.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
2020

2121
cmake --build . --config Release
2222
cd ..
23-
cp src/src/libssh2.lib %PYTHON%/libs/ || cp src/src/Release/libssh2.lib %PYTHON%/libs/

ci/appveyor/build_zlib.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ IF "%MSVC%" == "Visual Studio 9" (
1616
)
1717

1818
cmake --build . --config Release --target install
19-
cp C:/zlib/lib/zlibstatic.lib %PYTHON%/libs/
2019
cd ..
21-
ls %PYTHON%/libs/

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
sys.argv[1] in (
3333
'--help-commands', 'egg_info', '--version', 'clean',
3434
'sdist', '--long-description')) and
35-
__name__ == '__main__'):
35+
__name__ == '__main__'):
3636
build_ssh2()
3737

3838
ON_WINDOWS = platform.system() == 'Windows'
@@ -71,7 +71,9 @@
7171

7272
runtime_library_dirs = ["$ORIGIN/."] if not SYSTEM_LIBSSH2 else None
7373
_lib_dir = os.path.abspath("./src/src") if not SYSTEM_LIBSSH2 else "/usr/local/lib"
74-
include_dirs = ["libssh2/include"] if ON_RTD or not SYSTEM_LIBSSH2 else ["/usr/local/include"]
74+
include_dirs = ["libssh2/include"] if (ON_WINDOWS or ON_RTD) or \
75+
not SYSTEM_LIBSSH2 \
76+
else ["/usr/local/include"]
7577

7678
extensions = [
7779
Extension(sources[i].split('.')[0].replace(os.path.sep, '.'),

0 commit comments

Comments
 (0)