Skip to content

Commit 465f876

Browse files
authored
Channel dealloc (#19)
Fixed issue with channel double free when session open channel fails. Updated exception handling for session authentication. Updated tests. Removed unused exceptions. Added documentation. Updated readme, changelog.
1 parent 1747e32 commit 465f876

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2814
-6296
lines changed

Diff for: .circleci/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
flake8 ssh
3838
python setup.py sdist
3939
cd dist; pip install *; cd ..
40+
cd doc
41+
make html
42+
cd ..
4043
name: Test
4144

4245
osx:

Diff for: .environment.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
channels:
2+
- conda-forge
3+
dependencies:
4+
- python
5+
- setuptools
6+
- libssh
7+
- toolchain3
8+
- cython

Diff for: .readthedocs.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
conda:
2+
file: .environment.yml
3+
python:
4+
setup_py_install: true

Diff for: .travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ script:
3131
- flake8 ssh
3232
- python setup.py sdist
3333
- cd dist; pip install *; cd ..
34+
- cd doc
35+
- make html
36+
- cd ..
3437
jobs:
3538
include:
3639
- stage: build wheels

Diff for: Changelog.rst

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
Change Log
22
=============
33

4+
5+
0.5.0
6+
+++++
7+
8+
Changes
9+
--------
10+
11+
* Updated exception handling to match libssh API - `ssh.exceptions.SSHError` raised on all non-specific errors.
12+
* Updated authentication exception handling to raise specific authentication errors.
13+
* Channel object initialisation now requires Session object to be passed in.
14+
15+
16+
Fixes
17+
------
18+
19+
* Channel deallocation would crash on double free when session channel open failed.
20+
21+
422
0.4.0
523
+++++++
624

Diff for: README.rst

+11-12
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,25 @@ Bindings for libssh_ C library.
1717
:target: https://pypi.python.org/pypi/ssh-python
1818
.. image:: https://ci.appveyor.com/api/projects/status/2t4bmmtjvfy5s1in/branch/master?svg=true
1919
:target: https://ci.appveyor.com/project/pkittenis/ssh-python
20+
.. image:: https://readthedocs.org/projects/ssh-python/badge/?version=latest
21+
:target: http://ssh-python.readthedocs.org/en/latest/
22+
:alt: Latest documentation
2023

2124

2225
Installation
2326
_____________
2427

25-
Binary wheels are provided for Linux, OSX and Windows wheels to follow.
28+
Binary wheels are provided for Linux (manylinux 2010), OSX (10.14 and 10.15 for brew Python), and Windows 64-bit (Python 3.6/3.7/3.8).
29+
30+
Wheels have *no dependencies*. For building from source, see `documentation <http://ssh-python.readthedocs.org/en/latest/>`_.
2631

2732

2833
.. code-block:: shell
2934
3035
pip install ssh-python
3136
3237
33-
Project is beta status.
34-
35-
36-
Prerequisites
37-
--------------
38-
39-
* OpenSSL *or* gcrypt library and development headers
40-
* Optionally Zlib library and development headers for compression
41-
42-
``Libssh`` source code is embedded in this project and will be built when installation is triggered per above instructions.
43-
Versions of ``libssh`` other than the one embedded in this project are not supported.
38+
Project is beta status, please report any issues.
4439

4540

4641
Quick Start
@@ -90,10 +85,14 @@ _________
9085
The library uses `Cython`_ based native code extensions as wrappers to ``libssh``.
9186

9287
* Thread safe - GIL released as much as possible
88+
89+
* libssh threading limitations apply - anything not supported in C is not supported in Python
9390
* Very low overhead thin wrapper
9491
* Object oriented
92+
9593
* Memory freed automatically and safely as objects are garbage collected by Python
9694
* Uses Python semantics where applicable
95+
9796
* channel/file handle context manager support
9897
* channel/file handle iterator support
9998
* Raises low level C errors as Python exceptions

Diff for: doc/Changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../Changelog.rst

Diff for: doc/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Diff for: doc/api.rst

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
API Documentation
2+
********************
3+
4+
.. toctree::
5+
6+
session
7+
channel
8+
exceptions
9+
options
10+
key
11+
keytypes
12+
sftp
13+
sftp_handles
14+
sftp_attributes
15+
sftp_statvfs
16+
scp
17+
callbacks
18+
connector
19+
event
20+
utils

Diff for: doc/callbacks.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh.callbacks
2+
=============
3+
4+
.. automodule:: ssh.callbacks
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

Diff for: doc/channel.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh.channel
2+
===========
3+
4+
.. automodule:: ssh.channel
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

Diff for: doc/conf.py

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
import ssh
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
project = 'ssh-python'
22+
copyright = '2020, Panos Kittenis'
23+
author = 'Panos Kittenis'
24+
25+
26+
# -- General configuration ---------------------------------------------------
27+
28+
# Add any Sphinx extension module names here, as strings. They can be
29+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30+
# ones.
31+
32+
# Add any Sphinx extension module names here, as strings. They can be
33+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
34+
# ones.
35+
extensions = ['sphinx.ext.autodoc',
36+
'sphinx.ext.intersphinx',
37+
'sphinx.ext.todo',
38+
]
39+
40+
# Add any paths that contain templates here, relative to this directory.
41+
templates_path = ['_templates']
42+
43+
# List of patterns, relative to source directory, that match files and
44+
# directories to ignore when looking for source files.
45+
# This pattern also affects html_static_path and html_extra_path.
46+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
47+
48+
49+
# -- Options for HTML output -------------------------------------------------
50+
51+
# The theme to use for HTML and HTML Help pages. See the documentation for
52+
# a list of builtin themes.
53+
#
54+
html_theme = 'alabaster'
55+
56+
# Add any paths that contain custom static files (such as style sheets) here,
57+
# relative to this directory. They are copied after the builtin static files,
58+
# so a file named "default.css" will overwrite the builtin "default.css".
59+
html_static_path = ['_static']
60+
61+
62+
# -- Extension configuration -------------------------------------------------
63+
64+
# The version info for the project you're documenting, acts as replacement for
65+
# |version| and |release|, also used in various other places throughout the
66+
# built documents.
67+
#
68+
# The short X.Y version.
69+
version = ssh.__version__
70+
# The full version, including alpha/beta/rc tags.
71+
release = ssh.__version__
72+
73+
# The name of the Pygments (syntax highlighting) style to use.
74+
pygments_style = 'sphinx'
75+
76+
# If true, `todo` and `todoList` produce output, else they produce nothing.
77+
todo_include_todos = True
78+
79+
# List of patterns, relative to source directory, that match files and
80+
# directories to ignore when looking for source files.
81+
# This patterns also effect to html_static_path and html_extra_path
82+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
83+
84+
85+
# -- Options for HTML output ----------------------------------------------
86+
87+
# The theme to use for HTML and HTML Help pages. See the documentation for
88+
# a list of builtin themes.
89+
#
90+
html_theme = 'sphinx_rtd_theme'
91+
92+
# Theme options are theme-specific and customize the look and feel of a theme
93+
# further. For a list of options available for each theme, see the
94+
# documentation.
95+
#
96+
# html_theme_options = {}
97+
98+
# Add any paths that contain custom static files (such as style sheets) here,
99+
# relative to this directory. They are copied after the builtin static files,
100+
# so a file named "default.css" will overwrite the builtin "default.css".
101+
# html_static_path = ['_static']
102+
103+
# Custom sidebar templates, must be a dictionary that maps document names
104+
# to template names.
105+
#
106+
# This is required for the alabaster theme
107+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
108+
html_sidebars = {
109+
'**': [
110+
'about.html',
111+
'navigation.html',
112+
'relations.html', # needs 'show_related': True theme option to display
113+
'searchbox.html',
114+
]
115+
}
116+
117+
# Output file base name for HTML help builder.
118+
htmlhelp_basename = 'ssh-pythondoc'
119+
intersphinx_mapping = {'https://docs.python.org/': None}
120+
autoclass_content = "both"

Diff for: doc/connector.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh.connector
2+
=============
3+
4+
.. automodule:: ssh.connector
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

Diff for: doc/event.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh.event
2+
=========
3+
4+
.. automodule:: ssh.event
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

Diff for: doc/exceptions.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh.exceptions
2+
==============
3+
4+
.. automodule:: ssh.exceptions
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

Diff for: doc/index.rst

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
ssh-python documentation
2+
========================
3+
4+
Bindings for libssh_ C library.
5+
6+
.. image:: https://img.shields.io/badge/License-LGPL%20v2-blue.svg
7+
:target: https://pypi.python.org/pypi/ssh-python
8+
:alt: License
9+
.. image:: https://img.shields.io/pypi/v/ssh-python.svg
10+
:target: https://pypi.python.org/pypi/ssh-python
11+
:alt: Latest Version
12+
.. image:: https://circleci.com/gh/ParallelSSH/ssh-python/tree/master.svg?style=shield
13+
:target: https://circleci.com/gh/ParallelSSH/ssh-python/tree/master
14+
.. image:: https://img.shields.io/pypi/wheel/ssh-python.svg
15+
:target: https://pypi.python.org/pypi/ssh-python
16+
.. image:: https://img.shields.io/pypi/pyversions/ssh-python.svg
17+
:target: https://pypi.python.org/pypi/ssh-python
18+
.. image:: https://ci.appveyor.com/api/projects/status/2t4bmmtjvfy5s1in/branch/master?svg=true
19+
:target: https://ci.appveyor.com/project/pkittenis/ssh-python
20+
.. image:: https://readthedocs.org/projects/ssh-python/badge/?version=latest
21+
:target: http://ssh-python.readthedocs.org/en/latest/
22+
:alt: Latest documentation
23+
24+
25+
.. toctree::
26+
:maxdepth: 2
27+
:caption: Contents:
28+
29+
installation
30+
api
31+
Changelog
32+
33+
34+
Indices and tables
35+
==================
36+
37+
* :ref:`genindex`
38+
* :ref:`modindex`
39+
* :ref:`search`
40+
41+
.. _libssh: https://www.libssh.org

0 commit comments

Comments
 (0)