Skip to content

Commit 1747e32

Browse files
authored
OSX and Windows wheels (#18)
Added OSX wheel builds for 10.14 and 10.15 on Py3.8 Added Windows wheel builds for Python 3.6/3.7/3.8
1 parent c251ff4 commit 1747e32

19 files changed

+1392
-2120
lines changed

.appveyor.yml

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
max_jobs: 5
2+
build:
3+
parallel: true
4+
verbosity: minimal
5+
skip_branch_with_pr: true
6+
17
environment:
28
global:
3-
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
4-
# /E:ON and /V:ON options are not enabled in the batch script intepreter
5-
# See: http://stackoverflow.com/a/13751649/163740
6-
# CMD_IN_ENV: "cmd /E:ON /V:ON /C %APPVEYOR_BUILD_FOLDER%\\ci\\appveyor\\run_with_env.cmd"
79
PYTHONUNBUFFERED: 1
8-
OPENSSL_VER: 1.1.0h
910
SYSTEM_LIBSSH: 1
1011
PYPI_USER:
1112
secure: 2m0jy6JD/R9RExIosOT6YA==
@@ -40,8 +41,12 @@ install:
4041
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
4142
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
4243
throw "There are newer queued builds for this pull request, failing early." }
43-
- ECHO "Installed SDKs:"
44-
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
44+
- set OPENSSL_DIR="C:\OpenSSL-v11-Win%PYTHON_ARCH%"
45+
- set VCLIBDIR=%WINDIR%\System32
46+
- cp %VCLIBDIR%/vcruntime*.dll ssh/
47+
- cp %VCLIBDIR%/msvcp*.dll ssh/
48+
- cp %VCLIBDIR%/msvcr*.dll ssh/
49+
- cp %OPENSSL_DIR%/bin/*.dll ssh/
4550

4651
# Prepend newly installed Python to the PATH of this build (this cannot be
4752
# done from inside the powershell script as it would require to restart
@@ -51,57 +56,42 @@ install:
5156
# Check that we have the expected version and architecture for Python
5257
- "python --version"
5358
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
54-
55-
# Upgrade to the latest version of pip to avoid it displaying warnings
56-
# about it being out of date.
57-
# - "pip install --disable-pip-version-check --user --upgrade pip"
58-
59-
# Install the build dependencies of the project. If some dependencies contain
60-
# compiled extensions and are not provided as pre-built wheel packages,
61-
# pip will build them from source using the MSVC compiler matching the
62-
# target Python version and architecture
63-
- "%CMD_IN_ENV% pip install -r requirements_dev.txt"
64-
- "%CMD_IN_ENV% pip install -U wheel setuptools twine"
59+
- pip install -U wheel setuptools twine cython
6560

6661
# .c files need to be generated on Windows to handle platform
6762
# specific code.
6863
# Fix version used by versioneer to current git tag so the generated .c files
6964
# do not cause a version change.
7065
- python ci/appveyor/fix_version.py .
7166
- mv -f .git .git.bak
72-
- IF NOT "%PYTHON_VERSION%" == "2.7" (
73-
7z x ci\appveyor\zlib1211.zip
74-
appveyor DownloadFile https://indy.fulgan.com/SSL/Archive/Experimental/openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017.zip
75-
appveyor DownloadFile https://web.mit.edu/kerberos/dist/kfw/4.1/kfw-4.1-src.zip
76-
7z x ci\appveyor\kfw-4.1-src.zip
77-
7z x openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017.zip
78-
cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libssl-1_1-x%PYTHON_ARCH%.dll ssh\ || cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libssl-1_1.dll ssh\
79-
cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libcrypto-1_1-x%PYTHON_ARCH%.dll ssh\ || cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libcrypto-1_1.dll ssh\
80-
)
67+
- 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
8170
- ps: ls ssh
8271
- ps: ls
8372

8473
build_script:
85-
- "%CMD_IN_ENV% ci\\appveyor\\build_krb.bat"
86-
- "%CMD_IN_ENV% ci\\appveyor\\build_zlib.bat"
87-
- "%CMD_IN_ENV% ci\\appveyor\\build_ssh.bat"
74+
# - ci\\appveyor\\build_krb.bat
75+
- ci\\appveyor\\build_zlib.bat
76+
- ci\\appveyor\\build_ssh.bat
77+
- ps: ls src/src/Release
8878
- rm -f ssh/*.c
89-
- "%CMD_IN_ENV% python setup.py build_ext -I ci/appveyor/include"
90-
- "%CMD_IN_ENV% python setup.py build"
91-
- "%CMD_IN_ENV% python setup.py install"
79+
- python -V
80+
- python setup.py build_ext
81+
- python setup.py build
82+
- python setup.py install
83+
- ps: ls ssh
9284

9385
test_script:
9486
- cd dist
9587
- python ..\\ci\\appveyor\\import_test.py
9688
- cd ..
9789

9890
after_test:
99-
# If tests are successful, create binary packages for the project.
100-
- "%CMD_IN_ENV% python setup.py bdist_wheel"
91+
- python setup.py bdist_wheel
10192
- mv dist/* .
10293

10394
artifacts:
104-
# Archive the generated packages in the ci.appveyor.com build report.
10595
- path: "*.whl"
10696

10797
deploy_script:

.circleci/config.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,36 @@ jobs:
3838
python setup.py sdist
3939
cd dist; pip install *; cd ..
4040
name: Test
41+
4142
osx:
43+
parameters:
44+
xcode_ver:
45+
type: string
46+
default: "11.6.0"
4247
macos:
43-
xcode: 11.6.0
48+
xcode: << parameters.xcode_ver >>
4449
environment:
4550
HOMEBREW_NO_AUTO_UPDATE: 1
46-
PYENV: 3.6.11
4751
SYSTEM_LIBSSH: 1
4852
steps:
4953
- checkout
5054
- run:
5155
name: deps
5256
command: |
53-
brew install cmake git-lfs
54-
pip install twine
57+
brew install cmake git-lfs krb5 python libssh
58+
pip3 install twine
5559
which twine
60+
- run:
61+
name: Build Wheel
62+
command: |
63+
./ci/osx-wheel.sh
64+
- store_artifacts:
65+
path: wheels
66+
- run:
67+
name: Upload Wheel
68+
command: |
69+
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheels/*
70+
5671
manylinux:
5772
machine:
5873
image: ubuntu-1604:201903-01
@@ -92,6 +107,7 @@ jobs:
92107
name: Upload Wheels
93108
command: |
94109
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*
110+
95111
workflows:
96112
version: 2.1
97113
main:
@@ -113,7 +129,15 @@ workflows:
113129
only: /.*/
114130
branches:
115131
ignore: /.*/
116-
# - osx
117-
# filters:
118-
# tags:
119-
# only: /.*/
132+
- osx:
133+
matrix:
134+
parameters:
135+
xcode_ver:
136+
- "11.6.0"
137+
- "11.1.0"
138+
context: Docker
139+
filters:
140+
tags:
141+
only: /.*/
142+
branches:
143+
ignore: /.*/

Changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Packaging
1515
----------
1616

1717
* Added manylinux 2010 binary wheels.
18+
* Added OSX 10.14 and 10.15 binary wheels for Python 3.8
19+
* Added Windows 64-bit binary wheels for Python 3.6/3.7/3.8
1820

1921
0.3.0
2022
++++++++

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include versioneer.py
33
include ssh/_version.py
44
exclude .travis.yml
55
include LICENSE
6+
include COPYING
67
include ssh/*.pyx
78
include ssh/*.pxd
89
recursive-include libssh *

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Bindings for libssh_ C library.
1515
:target: https://pypi.python.org/pypi/ssh-python
1616
.. image:: https://img.shields.io/pypi/pyversions/ssh-python.svg
1717
:target: https://pypi.python.org/pypi/ssh-python
18+
.. image:: https://ci.appveyor.com/api/projects/status/2t4bmmtjvfy5s1in/branch/master?svg=true
19+
:target: https://ci.appveyor.com/project/pkittenis/ssh-python
20+
1821

1922
Installation
2023
_____________

_setup_libssh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def build_ssh():
1818
os.mkdir('src')
1919

2020
os.chdir('src')
21-
check_call('cmake -DCMAKE_BUILD_TYPE=Release ../libssh',
21+
check_call('cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GSS_API=ON ../libssh',
2222
shell=True, env=os.environ)
2323
check_call(['make', '-j%s' % (cpu_count(),)])
2424
os.chdir('..')

ci/appveyor/build_krb.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
refreshenv
12
set KRB_INSTALL_DIR=%APPVEYOR_HOME_DIR%/src/lib
23
set CPU=AMD64
34
setenv /x64 /release
45
cd kfw-4.1/src
5-
nmake
6-
nmake install
6+
make -f Makefile.in prep-windows
7+
make
8+
make install
79
cd ../..

ci/appveyor/build_ssh.bat

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
IF "%PYTHON_VERSION%" == "2.7" (exit 0)
22

3-
cp ci\appveyor\include\stdint.h libssh/include
4-
53
mkdir src
64
cd src
75

8-
set OPENSSL_DIR="C:\OpenSSL-v11-Win%PYTHON_ARCH%"
9-
10-
ls %OPENSSL_DIR%
11-
ls %OPENSSL_DIR%\lib\VC
12-
ls %OPENSSL_DIR%\lib\VC\static
13-
14-
IF "%MSVC%" == "Visual Studio 9" (
15-
ECHO "Building without platform set"
16-
set CMAKE_PLATFORM="NMake Makefiles"
17-
) ELSE (
18-
ECHO "Building with platform %MSVC%"
19-
set CMAKE_PLATFORM="%MSVC%"
20-
)
6+
set CMAKE_PLATFORM="%MSVC%"
217

228
cmake ..\libssh -G %CMAKE_PLATFORM% ^
239
-DCMAKE_BUILD_TYPE=Release ^
2410
-DZLIB_LIBRARY=C:/zlib/lib/zlibstatic.lib ^
2511
-DZLIB_INCLUDE_DIR=C:/zlib/include ^
2612
-DWITH_GSSAPI=ON ^
27-
-DWITH_STATIC_LIB=ON ^
2813
-DOPENSSL_ROOT_DIR=%OPENSSL_DIR%
2914

3015

@@ -34,9 +19,5 @@ cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
3419
cmake --build . --config Release
3520

3621
cd ..
37-
ls
38-
ls src/src/Release
39-
cp src/src/static/Release/ssh.lib %PYTHON%/libs/
40-
# cp src/src/Release/ssh.dll ssh/
41-
ls %PYTHON%/libs/
42-
ls ssh/
22+
cp src/src/Release/ssh.lib %PYTHON%/libs/
23+
cp src/src/Release/ssh.dll ssh/

ci/appveyor/import_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
sys.exit(0)
1212
print("{} {}".format(system(), python_version_tuple()[0]))
1313
raise
14+
else:
15+
print("Import successful")

0 commit comments

Comments
 (0)