Skip to content

Commit 065c208

Browse files
author
Pan
committed
Readme and documentation update.
1 parent 11e3a63 commit 065c208

File tree

2 files changed

+45
-18
lines changed

2 files changed

+45
-18
lines changed

README.rst

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,29 @@ Super fast SSH2 protocol library. ``ssh2-python`` provides Python bindings for `
2525
Installation
2626
______________
2727

28-
Binary wheel packages are provided for Linux, OSX and Windows, all Python versions, with ``libssh2`` and its required libraries included.
29-
30-
Wheel packages have **no dependencies**.
28+
Binary wheel packages are provided for Linux, OSX and Windows, all Python versions. Wheel packages have **no dependencies**.
3129

3230
``pip`` may need to be updated to be able to install binary wheel packages - ``pip install -U pip``.
3331

3432
.. code-block:: shell
3533
3634
pip install ssh2-python
3735
38-
39-
System packages are also available on the `latest release 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.
40-
41-
System packages have *no dependencies* other than the ``libssh2`` system library.
42-
4336
`Conda <https://conda.io/miniconda.html>`_ is another installation option - see `documentation <http://ssh2-python.readthedocs.org/en/latest/>`_ for more detailed instructions.
4437

38+
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>`_.
39+
4540

4641
API Feature Set
4742
________________
4843

49-
50-
At this time all of the `libssh2`_ API has been implemented up to version ``1.8.0``.
44+
At this time all of the `libssh2`_ API has been implemented up to version ``1.8.2``.
5145

5246
Complete example scripts for various operations can be found in the `examples directory`_.
5347

5448
In addition, as ``ssh2-python`` is a thin wrapper of ``libssh2`` with Python semantics, its code examples can be ported straight over to Python with only minimal changes.
5549

50+
5651
Library Features
5752
----------------
5853

@@ -65,16 +60,16 @@ Extension features:
6560
* Super fast as a consequence of the excellent C library it uses and prodigious use of native code
6661
* Object oriented - memory freed automatically and safely as objects are garbage collected by Python
6762
* Use Python semantics where applicable, such as context manager and iterator support for opening and reading from SFTP file handles
68-
* Expose errors as Python exceptions where possible
63+
* Raise errors as Python exceptions
6964
* Provide access to ``libssh2`` error code definitions
7065

7166

7267
Quick Start
7368
_____________
7469

75-
Both byte and unicode strings are accepted as arguments and encoded appropriately. To change default encoding, ``utf-8``, change the value of ``ssh2.utils.ENCODING``. Channel output is always byte strings.
70+
Both byte and unicode strings are accepted as arguments and encoded appropriately. To change default encoding, ``utf-8``, change the value of ``ssh2.utils.ENCODING``. Output is always in byte strings.
7671

77-
See `Complete Example`_ for a complete example including socket connect.
72+
See `Complete Example`_ for an example including socket connect.
7873

7974
Please use either the issue tracker for reporting issues with code or the `mail group`_ for discussion and questions.
8075

@@ -196,7 +191,7 @@ A simple usage example looks very similar to ``libssh2`` `usage examples <https:
196191

197192
See `examples directory <https://github.com/ParallelSSH/ssh2-python/tree/master/examples>`_ for more complete example scripts.
198193

199-
As mentioned, ``ssh2-python`` is intentially a thin wrapper over ``libssh2`` and directly maps most of its API.
194+
As mentioned, ``ssh2-python`` is intentionally a thin wrapper over ``libssh2`` and directly maps most of its API.
200195

201196
Clients using this library can be much simpler to use than interfacing with the ``libssh2`` API directly.
202197

doc/installation.rst

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ To use the built packages, install via the system's package manager, for example
3535
3636
.. note::
3737

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.
38+
System packages use the system provided ``libssh2`` which may need to be updated to be compatible with ``ssh2-python``. ``libssh2`` versions ``>= 1.6.0`` are compatible.
3939

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``.
40+
To build 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``.
4141

4242
Conda package
4343
===============
@@ -55,10 +55,42 @@ Installation from Source
5555

5656
To install from source, ``libssh2`` and Python development headers are required.
5757

58+
Custom build
59+
-------------
60+
61+
For best compatibility, it is recommended to use the ``libssh2`` submodule included in ``ssh2-python`` repository to build with.
62+
63+
.. code-block:: shell
64+
65+
git clone --recurse-submodules [email protected]:ParallelSSH/ssh2-python.git
66+
sudo ./ci/install-ssh2.sh
67+
virtualenv my_env
68+
source my_env/bin/activate
69+
python setup.py install
70+
71+
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.
72+
73+
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:
74+
75+
.. code-block:: shell
76+
77+
git clone --recurse-submodules [email protected]:ParallelSSH/ssh2-python.git
78+
sudo ./ci/install-ssh2.sh
79+
source my_env/bin/activate
80+
python setup.py build_ext -I /usr/local/include -R /usr/local/lib -L /usr/local/lib
81+
python setup.py install
82+
83+
System library build
84+
---------------------
85+
86+
Building against system provided ``libssh2`` is another option which may be preferred.
87+
88+
If the ``libssh2`` version provided by the system is not compatible, run the build with the ``EMBEDDED_LIB=0`` environment variable set. This will disable features that require ``libssh2`` >= ``1.6.0``.
89+
5890
Clone the repository, install dependencies and run install in a new virtualenv from the repository's root directory.
5991

6092
Ubuntu
61-
--------
93+
_______
6294

6395
.. code-block:: shell
6496
@@ -69,7 +101,7 @@ Ubuntu
69101
70102
71103
RedHat
72-
-------
104+
_______
73105

74106
.. code-block:: shell
75107

0 commit comments

Comments
 (0)