Skip to content

Commit

Permalink
Enable embedded libssh2 builds by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkittenis committed Jan 29, 2018
1 parent 99dcd6f commit 923d4fe
Show file tree
Hide file tree
Showing 12 changed files with 3,233 additions and 365 deletions.
32 changes: 15 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ addons:
- openssh-server
- rpm
- dpkg
- cmake
install:
- pip install flake8 jinja2
- 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
- python setup.py sdist
- cd dist; pip install *; cd ..
- cd doc; make html; cd ..
jobs:
include:
- stage: OSX wheel build
Expand Down Expand Up @@ -130,12 +134,19 @@ jobs:
# on:
# repo: ParallelSSH/ssh2-python
# tags: true
- stage: deploy_pypi
- stage: build and deploy source and wheels
if: tag IS present
os: linux
python: 3.6
install: skip
script: skip
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
Expand All @@ -146,16 +157,3 @@ jobs:
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="
- stage: build wheels
if: tag IS present
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
6 changes: 6 additions & 0 deletions ci/install-ssh2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -xe

mkdir -p src && cd src
cmake ../libssh2 -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCRYPTO_BACKEND=OpenSSL
cmake --build . --config Release --target install
14 changes: 10 additions & 4 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,24 @@ Wheel packages have **no dependencies**.
System Binary Packages
=======================

System packages are available on the `latest releases page <https://github.com/ParallelSSH/ssh2-python/releases/latest>`_ built on Centos/RedHat 6/7, Ubuntu 14.04/16.04, Debian 7/8 and Fedora 22/23/24.
System packages can be built for Centos/RedHat 6/7, Ubuntu 14.04/16.04, Debian 7/8 and Fedora 22/23/24 by running `ci/docker/build-packages.sh <https://github.com/ParallelSSH/ssh2-python/blob/master/ci/docker/build-packages.sh>`_ script in the repository's directory, based on Docker.

To use, download and install via the system's package manager, for example for Centos/RedHat based systems:
To use the built packages, install via the system's package manager, for example for Centos/RedHat based systems:

.. code-block:: shell
yum install -y python-ssh2-python-0.6.0-1.el7.x86_64.rpm
yum install -y python-ssh2-python-<version>-1.el7.x86_64.rpm
.. note::

System packages use the system provided ``libssh2`` which may need to be updated to be compatible with ``ssh2-python``. ``libssh2`` ersions ``>= 1.6.0`` are compatible.

To built an ``ssh2-python`` that is compatible with versions lower than ``1.6.0``, run the build with the ``EMBEDDED_LIB=0`` environment variable set. This will disable features that require ``libssh2`` >= ``1.6.0``.

Conda package
===============

A `conda <https://conda.io/miniconda.html>`_ package is available in the `conda-forge` channel.
A `conda <https://conda.io/miniconda.html>`_ package is available in the ``conda-forge`` channel.

To install, run the following.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# _comp_args = ["-ggdb"]
_comp_args = ["-O3"] if platform.system() != 'Windows' else None
_embedded_lib = bool(os.environ.get('EMBEDDED_LIB'))
_embedded_lib = bool(os.environ.get('EMBEDDED_LIB', 1))
cython_directives = {'embedsignature': True,
'boundscheck': False,
'optimize.use_switch': True,
Expand Down
13 changes: 13 additions & 0 deletions ssh2/error_codes.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 923d4fe

Please sign in to comment.