Skip to content

Commit 923d4fe

Browse files
author
Pan
committed
Enable embedded libssh2 builds by default.
1 parent 99dcd6f commit 923d4fe

12 files changed

+3233
-365
lines changed

.travis.yml

+15-17
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ addons:
1818
- openssh-server
1919
- rpm
2020
- dpkg
21+
- cmake
2122
install:
22-
- pip install flake8 jinja2
23+
- pip install flake8 jinja2 sphinx sphinx_rtd_theme
24+
- sudo ci/install-ssh2.sh
2325
- python setup.py build_ext --inplace
2426
- eval "$(ssh-agent -s)"
2527
script:
28+
- export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu
2629
- nosetests
2730
- flake8 ssh2
2831
- python setup.py sdist
2932
- cd dist; pip install *; cd ..
33+
- cd doc; make html; cd ..
3034
jobs:
3135
include:
3236
- stage: OSX wheel build
@@ -130,12 +134,19 @@ jobs:
130134
# on:
131135
# repo: ParallelSSH/ssh2-python
132136
# tags: true
133-
- stage: deploy_pypi
137+
- stage: build and deploy source and wheels
134138
if: tag IS present
135139
os: linux
136140
python: 3.6
137-
install: skip
138-
script: skip
141+
install:
142+
- pip install twine
143+
script:
144+
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
145+
- ./ci/travis/build-manylinux.sh
146+
after_success:
147+
- if [[ ! -z "$TRAVIS_TAG" ]]; then
148+
twine upload -u $PYPI_U -p $PYPI_P wheelhouse/*.whl;
149+
fi
139150
deploy:
140151
- provider: pypi
141152
skip_cleanup: true
@@ -146,16 +157,3 @@ jobs:
146157
user: pkittenis
147158
password:
148159
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="
149-
- stage: build wheels
150-
if: tag IS present
151-
os: linux
152-
python: 3.6
153-
install:
154-
- pip install twine
155-
script:
156-
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
157-
- ./ci/travis/build-manylinux.sh
158-
after_success:
159-
- if [[ ! -z "$TRAVIS_TAG" ]]; then
160-
twine upload -u $PYPI_U -p $PYPI_P wheelhouse/*.whl;
161-
fi

ci/install-ssh2.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash -xe
2+
3+
mkdir -p src && cd src
4+
cmake ../libssh2 -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
5+
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCRYPTO_BACKEND=OpenSSL
6+
cmake --build . --config Release --target install

doc/installation.rst

+10-4
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,24 @@ Wheel packages have **no dependencies**.
2525
System Binary Packages
2626
=======================
2727

28-
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.
28+
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.
2929

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

3232
.. code-block:: shell
3333
34-
yum install -y python-ssh2-python-0.6.0-1.el7.x86_64.rpm
34+
yum install -y python-ssh2-python-<version>-1.el7.x86_64.rpm
35+
36+
.. note::
37+
38+
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.
39+
40+
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``.
3541

3642
Conda package
3743
===============
3844

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

4147
To install, run the following.
4248

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
# _comp_args = ["-ggdb"]
3333
_comp_args = ["-O3"] if platform.system() != 'Windows' else None
34-
_embedded_lib = bool(os.environ.get('EMBEDDED_LIB'))
34+
_embedded_lib = bool(os.environ.get('EMBEDDED_LIB', 1))
3535
cython_directives = {'embedsignature': True,
3636
'boundscheck': False,
3737
'optimize.use_switch': True,

ssh2/error_codes.c

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)