Skip to content

Commit

Permalink
Added SCP implementation.
Browse files Browse the repository at this point in the history
Added SFTP, scp tests. Updated channel, session tests.
Updated sdist manifest. Added libssh python build script, added to setup.py for embedded build.
Updated travis cfg.
Added cython static C source files.
  • Loading branch information
pkittenis committed Sep 1, 2018
1 parent 6c6f1e7 commit 94a7dc1
Show file tree
Hide file tree
Showing 48 changed files with 121,564 additions and 404 deletions.
164 changes: 25 additions & 139 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ python:
- 3.4
- 3.5
- 3.6
- pypy
addons:
apt:
packages:
Expand All @@ -20,148 +19,35 @@ addons:
- cmake
install:
- pip install flake8 jinja2 sphinx sphinx_rtd_theme
- sudo ci/install-ssh2.sh
- python setup.py build_ext --inplace
- eval "$(ssh-agent -s)"
script:
- export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu
- nosetests
- flake8 ssh2
- flake8 ssh
- python setup.py sdist
- cd dist; pip install *; cd ..
- cd doc; make html; cd ..
jobs:
include:
- stage: OSX wheel build
os: osx
if: tag IS present
before_install:
- brew update
install:
- brew upgrade openssl
- sudo ci/install-ssh2.sh
- sudo -H pip2 install -U delocate twine wheel pip setuptools
- cp /usr/local/lib/libssh2* .
- ls -lh
- pip2 wheel .
script:
- delocate-listdeps --all *.whl
- delocate-wheel -v *.whl
- delocate-listdeps --all *.whl
- ls -l *.whl
- rm -f *.dylib
- pip2 install --user -v *.whl
- pwd; mkdir temp; cd temp; pwd
- python -c "from ssh2.session import Session; Session()"
- cd ..; pwd
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload -u $PYPI_U -p $PYPI_P *.whl;
fi
language: generic
python: skip
- stage: OSX wheel build
os: osx
osx_image: xcode8
if: tag IS present
before_install:
- brew update
install:
- brew upgrade openssl
- sudo ci/install-ssh2.sh
- sudo rm -f libssh2.1.dylib
- sudo -H pip2 install -U delocate twine wheel pip setuptools
- cp /usr/local/lib/libssh2* .
- ls -lh
- pip2 wheel .
script:
- delocate-listdeps --all *.whl
- delocate-wheel -v *.whl
- delocate-listdeps --all *.whl
- ls -l *.whl
- rm -f *.dylib
- pip2 install --user -v *.whl
- pwd; mkdir temp; cd temp; pwd
- python -c "from ssh2.session import Session; Session()"
- cd ..; pwd
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload -u $PYPI_U -p $PYPI_P *.whl;
fi
language: generic
python: skip
- stage: OSX wheel build
os: osx
osx_image: xcode6.4
if: tag IS present
before_install:
- brew update
install:
- brew upgrade openssl
- sudo ci/install-ssh2.sh
- ls -lh
- python --version
- wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
- sudo python get-pip.py
- sudo -H pip install -U pip
- sudo -H pip install -U delocate twine wheel setuptools
- cp /usr/local/lib/libssh2* .
- pip wheel .
script:
- delocate-listdeps --all *.whl
- delocate-wheel -v *.whl
- delocate-listdeps --all *.whl
- ls -l *.whl
- rm -f *.dylib
- pip install --user -v *.whl
- pwd; mkdir temp; cd temp; pwd
- python -c "from ssh2.session import Session; Session()"
- cd ..; pwd
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload -u $PYPI_U -p $PYPI_P *.whl;
fi
language: generic
python: skip
# - stage: build_packages
# if: tag IS present
# os: linux
# python: 3.6
# install: skip
# script: skip
# before_deploy:
# - 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 wheels
os: linux
python: 3.6
install:
- pip install twine
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- ./ci/travis/build-manylinux.sh
after_success:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
twine upload -u $PYPI_U -p $PYPI_P wheelhouse/*.whl;
fi
deploy:
- provider: pypi
skip_cleanup: true
on:
repo: ParallelSSH/ssh2-python
tags: true
distributions: sdist
user: pkittenis
password:
secure: "eEBo76bmNWArLOzLNkv8whYO81HqkYpwUu3RqBHv6PNW/sI70VSIVfPTWo8ThlNkYSBy1Sxci6eU+Vd8qYH/vaCbl4068BkzroGUqGMLHXLRLEPQjO2pxTvnQ7Nbj/Mi9enoslLJKflx2USy2iPz1yGCWZrPzjLWmEMcx6j5e3fEUGF2p6p01w/zWxmiSoyJgBsby9P8Fl5nflsNMVR/or8frK4K1T6Y2oTuEx9aYymmBPFOO5DHaedDxnhZ04KKaACIECvKrT5V3PMM1jrE3qu6hJ1LS0/mSivEdCwCszHanjIQy/enkNtLgxVm4jIRUjuAwL1MmxPtkAUcKrQor1YokMqm5fExdwvnp+qjtyejfA3IvT93nYvCj4IEYNMDtUGFUBjsYLqg7Ked/jvO53Ek5WEAE/Mx8F/OAtuvkpEeUKTIWxfd+V0b7pgShVuU5zFyi3y97vpRtdwqzOFr8QT3Hq+g/RIdghPQ9pGQ3GOomTMO1B7mAyOG6SYyQM/wra2h2dQTHCbgzAtsPzZLiZhWIGcU7/mGLm0kZBT6McnH2//hsIPXG8S94u2MWE0KRH5YhJ/2ATWneYyFHWQfwqDeR/1CZe66gFcPJ9cOIG+8pcmXueLhnueDbh2EWa8jmumtrAz+z+rcokih0c7catT7pByDv24Ouuw2Yf3my60="
# jobs:
# include:
# - stage: build wheels
# os: linux
# python: 3.6
# install:
# - pip install twine
# script:
# - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
# - ./ci/travis/build-manylinux.sh
# after_success:
# - if [[ ! -z "$TRAVIS_TAG" ]]; then
# twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl;
# fi
# deploy:
# - provider: pypi
# skip_cleanup: true
# on:
# repo: ParallelSSH/ssh-python
# tags: true
# distributions: sdist
# user: pkittenis
# password:
# secure: ""
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ include ssh/*.pyx
include ssh/*.pxd
recursive-include libssh *
include ci/build_ssh.sh
include _setup_libssh.py
22 changes: 22 additions & 0 deletions _setup_libssh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from subprocess import check_call
import os
from glob import glob
from shutil import copy2
from multiprocessing import cpu_count


def build_ssh():
if os.path.exists('/usr/local/opt/openssl'):
os.environ['OPENSSL_ROOT_DIR'] = '/usr/local/opt/openssl'

if not os.path.exists('src'):
os.mkdir('src')

os.chdir('src')
check_call('cmake -DCMAKE_BUILD_TYPE=Release ../libssh',
shell=True, env=os.environ)
check_call(['make', '-j%s' % (cpu_count(),)])
os.chdir('..')

for src in glob('src/src/libssh.so*'):
copy2(src, 'ssh/')
11 changes: 11 additions & 0 deletions ci/travis/build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -xe

docker_tag="parallelssh/ssh-manylinux"

rm -rf build dist

docker pull $docker_tag || echo
docker build --cache-from $docker_tag ci/docker/manylinux -t $docker_tag
docker push $docker_tag
docker run --rm -v `pwd`:/io $docker_tag /io/ci/travis/build-wheels.sh
ls wheelhouse/
17 changes: 17 additions & 0 deletions ci/travis/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -xe

# Compile wheels
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done

# Install packages and test
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
"${PYBIN}/pip" install ssh-python --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh.session import Session; Session()')
done
43 changes: 43 additions & 0 deletions ci/travis/pyenv-wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash -xe

brew install pyenv || brew outdated pyenv || brew upgrade pyenv

export PYENV_VERSION=${PYENV:-3.6.4}
if [[ ! -d "$HOME/.pyenv/versions/$PYENV_VERSION" ]]; then
pyenv install $PYENV_VERSION
fi
pyenv global $PYENV_VERSION
pyenv versions

set +x
eval "$(pyenv init -)"
set -x

which python
python -m pip install -U virtualenv
python -m virtualenv -p "$(which python)" venv

set +x
source venv/bin/activate
set -x

python -V
python -m pip install -U setuptools pip
pip install -U delocate wheel
pip wheel .
delocate-listdeps --all *.whl
delocate-wheel -v *.whl
delocate-listdeps --all *.whl

ls -l *.whl
rm -f *.dylib
pip install -v *.whl
pwd; mkdir -p temp; cd temp; pwd
python -c "from ssh.session import Session; Session()"
cd ..; pwd
set +x
deactivate
set -x

mv -f *.whl wheels/
ls -lh wheels
10 changes: 1 addition & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
from __future__ import print_function

import platform
import os
import sys
from glob import glob
# from multiprocessing import cpu_count
from subprocess import check_call
from _setup_libssh import build_ssh

import versioneer
from setuptools import setup, find_packages
Expand All @@ -22,11 +19,6 @@
USING_CYTHON = True


def build_ssh():
cmd = './ci/build_ssh.sh'
return check_call(cmd, env=os.environ, shell=True)


# Only build libssh if running a build
if (len(sys.argv) >= 2 and not (
'--help' in sys.argv[1:] or
Expand Down
Loading

0 comments on commit 94a7dc1

Please sign in to comment.