Skip to content

Commit

Permalink
New release (#68)
Browse files Browse the repository at this point in the history
Disabled OSX 10.11 wheel builds
Updated travis cfg for osx builds
Removed system package builds. Updated travis cfg to not login or push to docker on PR builds.
Switched testing to pytest.
Removed channel close on channel object de-allocation. Removed GIL release on session and channel object de-allocation. Updated Changelog.
Removed out of repo package files before building wheels and updated gitignore - resolves #14
Migrated manylinux wheel builds to openssl 1.1.
Migrated Windows builds to openssl 1.1.
Updated changelog. Updated manylinux wheel embedded libssh2 version.
  • Loading branch information
pkittenis committed Mar 11, 2019
1 parent edcd20a commit a3d077e
Show file tree
Hide file tree
Showing 50 changed files with 2,371 additions and 1,876 deletions.
22 changes: 4 additions & 18 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:
CMD_IN_ENV: "cmd /E:ON /V:ON /C %APPVEYOR_BUILD_FOLDER%\\ci\\appveyor\\run_with_env.cmd"
PYTHONUNBUFFERED: 1
EMBEDDED_LIB: 1
OPENSSL_VER: 1.0.2q
OPENSSL_VER: 1.1.0h
PYPI_USER:
secure: 2m0jy6JD/R9RExIosOT6YA==
PYPI_PASS:
Expand All @@ -26,20 +26,6 @@ environment:
ARCH: x64_86
SYSTEM_LIBSSH2: 1

- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "32"
MSVC: "Visual Studio 10"
ARCH: i386
SYSTEM_LIBSSH2: 1

- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "64"
MSVC: "Visual Studio 10 Win64"
ARCH: x64_86
SYSTEM_LIBSSH2: 1

- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "32"
Expand Down Expand Up @@ -123,9 +109,9 @@ install:
- python ci/appveyor/fix_version.py .
- mv -f .git .git.bak
- 7z x ci\appveyor\zlib1211.zip
- 7z x ci\appveyor\openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip
- cp ssleay32.dll ssh2\
- cp libeay32.dll ssh2\
- 7z x ci\appveyor\openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017.zip
- cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libssl-1_1-x%PYTHON_ARCH%.dll ssh2\ || cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libssl-1_1.dll ssh2\
- cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libcrypto-1_1-x%PYTHON_ARCH%.dll ssh2\ || cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libcrypto-1_1.dll ssh2\
- ps: ls ssh2
build_script:
- "%CMD_IN_ENV% ci\\appveyor\\build_zlib.bat"
Expand Down
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ openssl-1.0.2q-i386-win32.zip filter=lfs diff=lfs merge=lfs -text
openssl-1.0.2q-x64_86-win64.zip filter=lfs diff=lfs merge=lfs -text
zlib1211.zip filter=lfs diff=lfs merge=lfs -text
*.tar.gz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
ci/docker/manylinux/libssh2.tar.gz filter=lfs diff=lfs merge=lfs -text
ci/docker/manylinux/cmake-2.8.11.1-5.4.x86_64.rpm filter=lfs diff=lfs merge=lfs -text
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build
*~
*.so
.idea/
ssh2/libssh2.so*
46 changes: 16 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cache:
- pip
- directories:
- "$HOME/.pyenv"
- "$HOME/Library/Caches/Homebrew"
notifications:
email: false
sudo: required
Expand All @@ -26,7 +27,7 @@ install:
- python setup.py build_ext --inplace
- eval "$(ssh-agent -s)"
script:
- nosetests
- pytest tests
- flake8 ssh2
# Test source distribution builds
- python setup.py sdist
Expand All @@ -44,12 +45,14 @@ jobs:
- &osx-wheels
stage: build packages
os: osx
osx_image: xcode8
osx_image: xcode9.2
env:
- PYENV: 3.6.4
- SYSTEM_LIBSSH2: 1
before_cache:
- brew cleanup
before_install:
- brew update
- brew install ccache
- brew outdated openssl || travis_wait brew upgrade openssl || echo "y"
- brew link --overwrite python@2 || brew install python@2 || brew link --overwrite python@2
- which python2
Expand All @@ -74,7 +77,6 @@ jobs:
- python -c "from ssh2.session import Session; Session()"
- cd ..; pwd
- mv -f *.whl wheels/
- travis_wait ./ci/travis/pyenv-wheel.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheels/*.whl;
Expand All @@ -86,12 +88,18 @@ jobs:
osx_image: xcode9.2

- <<: *osx-wheels
osx_image: xcode9.4
osx_image: xcode9.2
env:
- PYENV: 3.6.4
- SYSTEM_LIBSSH2: 1
install: skip
script:
- travis_wait ./ci/travis/pyenv-wheel.sh

- <<: *osx-wheels
osx_image: xcode8
osx_image: xcode9.4
env:
- PYENV: 3.7.0
- PYENV: 3.6.4
- SYSTEM_LIBSSH2: 1
install: skip
script:
Expand All @@ -115,28 +123,6 @@ jobs:
script:
- travis_wait ./ci/travis/pyenv-wheel.sh

- stage: build packages
env:
- SYSTEM_PACKAGES=1
os: linux
language: generic
python: skip
install: skip
script:
- docker --version
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- ./ci/docker/build-packages.sh
deploy:
- provider: releases
skip_cleanup: true
api_key:
secure: i1Dr0k393wXBsCKST5ckeTPdZT+hjkikHCGgMSEkJxw+Q8m/Sgq9bbBalkJZDZDc8t0a/nE4ioEXoYO+PT9wRSpjLbjDVwRoWde5PVHaR3JviiwxULEynFLbvdJ1S2O/zRM37YMVgIIXN/2SWSXvQcQznrrvjtBoV+nZfYHX2WZQruq1nQXcPvTJPeZtCBsWaA3TwbVobnOJdb3TFxnHybN3N4gCTOkurek0V7OSMpjd1qgSzNMDIhjXKf/ZB9bcuusXo2QSnzUDJo3S6QE4FBxKohVom7z4AQ8+iRVPkkrWezBo089vzPzfZN/C5+8xQAUfZ6bVNdS6DfI80+55s6Xj7BFEKQW9Kh3Em0GpipHxdxiBf176xktY9EROkDkwDHlsbE7JRRQUmfmJe+0yCo+gg9uAsz5XHNrQgU5BxKhVzggMA/VU+clJ51WfbYGJAvVs/NjHQb/A9CzYKdBamUvy3YY2dxLbdohR7TZMM0JWYmZcmSiaOiZxrCT3ThlQ/J9o9r6TFWvkVjvt+ozABsx0OvtNrdkp7VvFbSQGvmTzGnPM2O5xqzWrM73Z7g8Ahw1g08FDN0JAO8n/Y0tb/xpVAFBmkQTJpQk7f4kQAHWlZKEYN2wEnX+hptjXfDjMYGX9Tc5vdDQJ3oTxnCt+y7Vl9IplT0a5GTTE0l8Pyc4=
file_glob: true
file: '*.{deb,rpm}'
on:
repo: ParallelSSH/ssh2-python
tags: true

- stage: build packages
os: linux
python: 3.6
Expand All @@ -145,7 +131,7 @@ jobs:
install:
- pip install twine
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi
- ./ci/travis/build-manylinux.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
Expand Down
21 changes: 21 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
Change Log
=============

0.18.0
+++++++

Changes
--------

* Session object de-allocation no longer calls session disconnect.
* Channel object de-allocation no longer calls channel close.
* Rebuilt sources with Cython ``0.29.6``.
* Updated Linux and Windows binary wheels to OpenSSL 1.1.
* Updated embedded ``libssh2`` to latest master.
* Added ``Ed25519`` publickey support via ``libssh2`` and OpenSSL upgrades.

Packaging
----------

* Source distribution builds would not include embedded libssh2 module in package - #51
* Removed OSX 10.10 binary wheel builds - deprecated by Travis-CI.
* Updated embedded OpenSSL version for Windows wheel builds.


0.17.0.post2
+++++++++++++

Expand Down
11 changes: 5 additions & 6 deletions ci/appveyor/build_ssh2.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ mkdir src
cd src

IF "%PYTHON_ARCH%" == "32" (
set OPENSSL_DIR="C:\OpenSSL-Win32"
set OPENSSL_DIR="C:\OpenSSL-v11-Win32"
) ELSE (
set OPENSSL_DIR="C:\OpenSSL-Win64"
set OPENSSL_DIR="C:\OpenSSL-v11-Win64"
)

ls %OPENSSL_DIR%\lib
Expand Down Expand Up @@ -42,10 +42,9 @@ REM -DOPENSSL_MSVC_STATIC_RT=TRUE
REM -DOPENSSL_USE_STATIC_LIBS=TRUE
)

cp %OPENSSL_DIR%\lib\VC\libeay32MD.lib %APPVEYOR_BUILD_FOLDER%
cp %OPENSSL_DIR%\lib\VC\ssleay32MD.lib %APPVEYOR_BUILD_FOLDER%
REM cp %OPENSSL_DIR%\libeay32.dll %APPVEYOR_BUILD_FOLDER%\ssh2\
REM cp %OPENSSL_DIR%\ssleay32.dll %APPVEYOR_BUILD_FOLDER%\ssh2\

cp %OPENSSL_DIR%\lib\VC\libcrypto%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%

cmake --build . --config Release
cd ..
Expand Down
3 changes: 3 additions & 0 deletions ci/appveyor/openssl-1.1.0h-x32-VC2017.zip
Git LFS file not shown
3 changes: 3 additions & 0 deletions ci/appveyor/openssl-1.1.0h-x64-VC2017.zip
Git LFS file not shown
20 changes: 13 additions & 7 deletions ci/docker/manylinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
FROM quay.io/pypa/manylinux1_x86_64

ENV CMAKE cmake-2.8.11.1-5.4.x86_64
ENV OPENSSL openssl-1.0.2p
ENV OPENSSL openssl-1.1.1b
ENV SYSTEM_LIBSSH2 1

RUN yum install zlib-devel -y

ADD libssh2.tar.gz libssh2.tar.gz
ADD ${CMAKE}.rpm cmake.rpm
ADD http://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
ADD ${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
ADD local-perl-5.10.0-62.ep.x86_64.rpm local-perl.rpm
ADD local-perl-Pod-Simple-3.07-62.ep.x86_64.rpm local-perl-Pod-Simple.rpm
ADD local-perl-Module-Pluggable-3.60-62.ep.x86_64.rpm local-perl-Module-Pluggable.rpm
ADD local-perl-XSLoader-0.10-1.noarch.rpm local-perl-XSLoader.rpm
ADD local-perl-version-0.74-62.ep.x86_64.rpm local-perl-version.rpm
ADD local-perl-libs-5.10.0-62.ep.x86_64.rpm local-perl-libs.rpm
ADD local-perl-Pod-Escapes-1.04-62.ep.x86_64.rpm local-perl-Pod-Escapes.rpm

RUN rpm -i cmake.rpm
RUN rpm -i cmake.rpm local-perl-Module-Pluggable.rpm local-perl-Pod-Escapes.rpm local-perl-Pod-Simple.rpm local-perl-XSLoader.rpm local-perl-version.rpm local-perl-libs.rpm local-perl.rpm

# Openssl
RUN tar -xzf ${OPENSSL}.tar.gz && \
cd ${OPENSSL} && \
RUN cd ${OPENSSL}.tar.gz/${OPENSSL} && \
./config --prefix=/usr --openssldir=/usr/openssl threads shared && \
make -j4 && make install

# Libssh2
RUN mkdir -p build_libssh2 && cd build_libssh2 && \
cmake ../libssh2.tar.gz -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
cmake ../libssh2.tar.gz/libssh2-master -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCMAKE_INSTALL_PREFIX=/usr && \
cmake --build . --config Release --target install

RUN rm -rf ${OPENSSL}* build_libssh2
RUN rm -rf ${OPENSSL}* build_libssh2 libssh2.tar.gz

VOLUME /var/cache
Binary file modified ci/docker/manylinux/cmake-2.8.11.1-5.4.x86_64.rpm
Binary file not shown.
Binary file modified ci/docker/manylinux/libssh2.tar.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions ci/docker/manylinux/local-perl-5.10.0-62.ep.x86_64.rpm
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions ci/docker/manylinux/local-perl-XSLoader-0.10-1.noarch.rpm
Git LFS file not shown
3 changes: 3 additions & 0 deletions ci/docker/manylinux/local-perl-libs-5.10.0-62.ep.x86_64.rpm
Git LFS file not shown
3 changes: 3 additions & 0 deletions ci/docker/manylinux/local-perl-version-0.74-62.ep.x86_64.rpm
Git LFS file not shown
3 changes: 3 additions & 0 deletions ci/docker/manylinux/openssl-1.1.1b.tar.gz
Git LFS file not shown
4 changes: 2 additions & 2 deletions ci/travis/build-manylinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

docker_tag="parallelssh/ssh2-manylinux"

rm -rf build dist
rm -rf build dist ssh2/libssh2.*

docker pull $docker_tag || echo
docker build --cache-from $docker_tag ci/docker/manylinux -t $docker_tag
docker push $docker_tag
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker push $docker_tag; fi
docker run --rm -v `pwd`:/io $docker_tag /io/ci/travis/build-wheels.sh
ls wheelhouse/
6 changes: 1 addition & 5 deletions examples/publickey_fromfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,13 @@ def main():
if not os.path.isfile(args.privatekey):
print("No such private key %s" % (args.privatekey,))
sys.exit(1)
publickey = "%s.pub" % (args.privatekey,)
if not os.path.isfile(publickey):
print("Expected public key at %s, found none" % (publickey,))
sys.exit(1)

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((args.host, args.port))
s = Session()
s.handshake(sock)
s.userauth_publickey_fromfile(
args.user, publickey, args.privatekey, args.passphrase)
args.user, args.privatekey, passphrase=args.passphrase)
chan = s.open_session()
chan.execute(args.cmd)
size, data = chan.read()
Expand Down
6 changes: 3 additions & 3 deletions libssh2/docs/libssh2_hostkey_hash.3
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ libssh2_hostkey_hash(LIBSSH2_SESSION *session, int hash_type);
\fIsession\fP - Session instance as returned by
.BR libssh2_session_init_ex(3)

\fIhash_type\fP - One of: \fBLIBSSH2_HOSTKEY_HASH_MD5\fP or
\fBLIBSSH2_HOSTKEY_HASH_SHA1\fP.
\fIhash_type\fP - One of: \fBLIBSSH2_HOSTKEY_HASH_MD5\fP,
\fBLIBSSH2_HOSTKEY_HASH_SHA1\fP or \fBLIBSSH2_HOSTKEY_HASH_SHA256\fP.

Returns the computed digest of the remote system's hostkey. The length of
the returned string is hash_type specific (e.g. 16 bytes for MD5,
20 bytes for SHA1).
20 bytes for SHA1, 32 bytes for SHA256).
.SH RETURN VALUE
Computed hostkey hash value, or NULL if the information is not available
(either the session has not yet been started up, or the requested hash
Expand Down
8 changes: 5 additions & 3 deletions libssh2/example/ssh2_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ int main(int argc, char *argv[])

shutdown:

libssh2_agent_disconnect(agent);
libssh2_agent_free(agent);

if (agent) {
libssh2_agent_disconnect(agent);
libssh2_agent_free(agent);
}

if(session) {
libssh2_session_disconnect(session,
"Normal Shutdown, Thank you for playing");
Expand Down
3 changes: 3 additions & 0 deletions libssh2/include/libssh2_sftp.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ typedef struct _LIBSSH2_SFTP_STATVFS LIBSSH2_SFTP_STATVFS;
#define LIBSSH2_SFTP_READLINK 1
#define LIBSSH2_SFTP_REALPATH 2

/* Flags for sftp_mkdir() */
#define LIBSSH2_SFTP_DEFAULT_MODE -1

/* SFTP attribute flag bits */
#define LIBSSH2_SFTP_ATTR_SIZE 0x00000001
#define LIBSSH2_SFTP_ATTR_UIDGID 0x00000002
Expand Down

0 comments on commit a3d077e

Please sign in to comment.