Skip to content

Commit 26a372b

Browse files
author
Pan
committed
Updated readme, installation instructions in documentation.
Updated setup.py for readthedocs builds. Updated travis cfg. Updated PyPi classifiers.
1 parent c3206df commit 26a372b

File tree

4 files changed

+36
-27
lines changed

4 files changed

+36
-27
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- SYSTEM_LIBSSH2: 1
4242
before_install:
4343
- brew update
44-
- brew outdated openssl || brew upgrade openssl || echo "y"
44+
- brew outdated openssl || travis_wait brew upgrade openssl || echo "y"
4545
- brew link --overwrite python@2 || brew install python@2 || brew link --overwrite python@2
4646
- which python2
4747
- python2 -c "from __future__ import print_function; import ssl; from platform import python_version; print(ssl.OPENSSL_VERSION); print(python_version())"

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Binary wheel packages are provided for Linux, OSX and Windows, all Python versio
3535
3636
`Conda <https://conda.io/miniconda.html>`_ is another installation option - see `documentation <http://ssh2-python.readthedocs.org/en/latest/>`_ for more detailed instructions.
3737

38+
For from source installation instructions, including building against system provided libssh2, `see documentation <https://ssh2-python.readthedocs.io/en/latest/installation.html#installation-from-source>`_.
39+
3840
For creating native system packages for Centos/RedHat, Ubuntu, Debian and Fedora, see `instructions in the documentation <http://ssh2-python.readthedocs.io/en/latest/installation.html#system-binary-packages>`_.
3941

4042

doc/installation.rst

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,62 +55,76 @@ To install, run the following.
5555
Installation from Source
5656
==========================
5757

58-
To install from source, ``libssh2`` and Python development headers are required.
58+
Source distributions inlude a bundled ``libssh2`` which is built automatically by default. OpenSSL development libraries are required.
5959

60-
Custom build
61-
-------------
60+
For builds against system provided ``libssh2``, the ``SYSTEM_LIBSSH2=1`` environment variable setting can be used.
6261

63-
For best compatibility, it is recommended to use the ``libssh2`` submodule included in ``ssh2-python`` repository to build with.
62+
Standard build
63+
---------------
64+
65+
Source distributions include a bundled ``libssh2`` which is used by default.
6466

6567
.. code-block:: shell
6668
67-
git clone --recurse-submodules [email protected]:ParallelSSH/ssh2-python.git
68-
sudo ./ci/install-ssh2.sh
69+
git clone [email protected]:ParallelSSH/ssh2-python.git
6970
virtualenv my_env
7071
source my_env/bin/activate
7172
python setup.py install
7273
73-
The ``sudo ./ci/install-ssh2.sh`` line will install a version of ``libssh2`` under ``/usr/local`` that is the same version used to build binary wheels with and is ensured to be compatible.
7474
75-
If there are multiple development headers and/or libraries for ``libssh2`` on the system, the following can be used to set the include path, runtime and build library directories:
75+
System library build
76+
---------------------
77+
78+
Building against system provided ``libssh2`` is another option which may be preferred. This can be done by setting the ``SYSTEM_LIBSSH2=1`` environment variable:
7679

7780
.. code-block:: shell
7881
79-
git clone --recurse-submodules [email protected]:ParallelSSH/ssh2-python.git
80-
sudo ./ci/install-ssh2.sh
82+
git clone [email protected]:ParallelSSH/ssh2-python.git
8183
virtualenv my_env
8284
source my_env/bin/activate
83-
python setup.py build_ext -I /usr/local/include -R /usr/local/lib/x86_64-linux-gnu -L /usr/local/lib/x86_64-linux-gnu
85+
export SYSTEM_LIBSSH2=1
8486
python setup.py install
8587
86-
System library build
87-
---------------------
8888
89-
Building against system provided ``libssh2`` is another option which may be preferred.
89+
Custom Compiler Configuration
90+
-------------------------------
91+
92+
If there are multiple ``libssh2`` installations on the system, the following can be used to set the include path, runtime and build time library directory paths respectively:
9093

91-
If the ``libssh2`` version provided by the system is not compatible, run the build with the ``EMBEDDED_LIB=0`` and ``HAVE_AGENT_FWD=0`` environment variables set. This will disable features that require ``libssh2`` >= ``1.6.0`` as well as agent forwarding implementation which is only present in the ``libssh2`` submodule of this repository.
94+
.. code-block:: shell
95+
96+
git clone [email protected]:ParallelSSH/ssh2-python.git
97+
virtualenv my_env
98+
source my_env/bin/activate
99+
python setup.py build_ext -I /usr/local/include -R /usr/local/lib/x86_64-linux-gnu -L /usr/local/lib/x86_64-linux-gnu
100+
python setup.py install
92101
93-
Clone the repository, install dependencies and run install in a new virtualenv from the repository's root directory.
94102
95103
Ubuntu
96104
_______
97105

106+
Example for Debian or Ubuntu based distributions.
107+
98108
.. code-block:: shell
99109
100110
sudo apt-get install libssh2-1-dev python-dev
101111
virtualenv my_env
102112
source my_env/bin/activate
113+
export SYSTEM_LIBSSH2=1
103114
python setup.py install
104115
105116
106117
RedHat
107118
_______
119+
120+
Example for RedHat based distributions.
108121

109122
.. code-block:: shell
110123
111124
sudo yum install libssh2-devel python-devel
112125
virtualenv my_env
113126
source my_env/bin/activate
127+
export SYSTEM_LIBSSH2=1
114128
python setup.py install
115129
116130

setup.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
else:
2323
USING_CYTHON = True
2424

25+
ON_RTD = os.environ.get('READTHEDOCS') == 'True'
2526

26-
SYSTEM_LIBSSH2 = bool(os.environ.get('SYSTEM_LIBSSH2', 0))
27+
SYSTEM_LIBSSH2 = bool(os.environ.get('SYSTEM_LIBSSH2', 0)) or ON_RTD
2728

2829
# Only build libssh if running a build
2930
if not SYSTEM_LIBSSH2 and (len(sys.argv) >= 2 and not (
@@ -35,13 +36,6 @@
3536
build_ssh2()
3637

3738
ON_WINDOWS = platform.system() == 'Windows'
38-
ON_RTD = os.environ.get('READTHEDOCS') == 'True'
39-
40-
if ON_RTD:
41-
files = glob('ssh2/*.c')
42-
for _file in files:
43-
os.remove(_file)
44-
4539

4640
ext = 'pyx' if USING_CYTHON else 'c'
4741
sources = glob('ssh2/*.%s' % (ext,))
@@ -76,7 +70,7 @@
7670

7771
runtime_library_dirs = ["$ORIGIN/."] if not SYSTEM_LIBSSH2 else None
7872
_lib_dir = os.path.abspath("./src/src") if not SYSTEM_LIBSSH2 else "/usr/local/lib"
79-
include_dirs = ["libssh2/include"] if not SYSTEM_LIBSSH2 else ["/usr/local/include"]
73+
include_dirs = ["libssh2/include"] if ON_RTD or not SYSTEM_LIBSSH2 else ["/usr/local/include"]
8074

8175
extensions = [
8276
Extension(sources[i].split('.')[0].replace(os.path.sep, '.'),
@@ -126,7 +120,6 @@
126120
'Programming Language :: C',
127121
'Programming Language :: Python',
128122
'Programming Language :: Python :: 2',
129-
'Programming Language :: Python :: 2.6',
130123
'Programming Language :: Python :: 2.7',
131124
'Programming Language :: Python :: 3',
132125
'Programming Language :: Python :: 3.4',

0 commit comments

Comments
 (0)