Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Changes
was called on a `SFTPHandle` or not.
* Added `ssh2.channel.Channel.signal` function for sending signals over SSH to an open channel - #221
* Added `ssh2.session.Session.direct_streamlocal_ex` for creating `Channel` objects tunneling a local UNIX socket
via the remote host to a third party.
via the remote host to a third party - #40
* Added new `libssh2` error codes under `ssh2.error_codes`, equivalent Python exceptions under `ssh2.exceptions`
and updated error code handling for all functions.
* Removed deprecated `libssh2` `ssh2.channel.Channel` functions `receive_window_adjust`, `handle_extended_data`
Expand All @@ -27,6 +27,7 @@ Packaging
----------

* Removed Windows Python 3.7 wheel builds.
* OSX binary wheels now use embedded `libssh2` rather than brew package.


1.1.2
Expand Down
4 changes: 2 additions & 2 deletions _setup_libssh2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@


def build_ssh2():
if bool(os.environ.get('SYSTEM_LIBSSH', False)):
stderr.write("Using system libssh2..%s" % (os.sep))
if bool(os.environ.get('SYSTEM_LIbBSSH2', False)):
stderr.write("Using system libssh2..%s" % (os.sep,))
return
if os.path.exists('/usr/local/opt/openssl'):
os.environ['OPENSSL_ROOT_DIR'] = '/usr/local/opt/openssl'
Expand Down
27 changes: 19 additions & 8 deletions ci/osx-wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,44 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
LIBSSH2_DIR="/opt/homebrew/opt/libssh2/lib"
SYSTEM_LIBSSH2_DIR="/opt/homebrew/opt/libssh2/lib"
MY_LIBSSH2_DIR="build_dir/src/"
LIBSSH2_INCLUDE_DIR="/opt/homebrew/opt/libssh2/include"
export LDFLAGS="-L${LIBSSH2_DIR}"
set +x

export CPPFLAGS="-I${LIBSSH2_INCLUDE_DIR}"
sudo cp -a libssh2/include/* /opt/homebrew/opt/libssh2/include/

pip3 install -U virtualenv
python3 -m virtualenv -p "$(which python3)" venv

set +x
source venv/bin/activate
set -x

python -V
pip3 install -U setuptools pip
pip3 install -U delocate wheel
SYSTEM_LIBSSH2=1 python3 setup.py bdist_wheel
ls -lhtr ${LIBSSH2_DIR}
unset SYSTEM_LIBSSH2

python3 setup.py bdist_wheel

sudo cp -a ${MY_LIBSSH2_DIR}/libssh2* ${SYSTEM_LIBSSH2_DIR}/
ls -lhtr ${SYSTEM_LIBSSH2_DIR}

delocate-listdeps dist/*.whl
delocate-wheel -v -w wheels dist/*.whl
delocate-listdeps wheels/*.whl

ls -l wheels/*.whl
rm -f ${LIBSSH2_DIR}/libssh2*
rm -f ${SYSTEM_LIBSSH2_DIR}/libssh2*
rm -rf build_dir
ls -lhtr ${SYSTEM_LIBSSH2_DIR}

pip3 install -v wheels/*.whl

pwd; mkdir -p temp; cd temp; pwd
python3 -c "from ssh2.session import Session; Session()" && echo "Import successful"
cd ..; pwd
set +x

deactivate

set -x
5 changes: 5 additions & 0 deletions ssh2/c_ssh2.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ cdef extern from "libssh2.h" nogil:
# Session flags
LIBSSH2_FLAG_SIGPIPE
LIBSSH2_FLAG_COMPRESS
# Path flags
LIBSSH2_FLAG_QUOTE_PATHS
# Flags for SK authentication
LIBSSH2_SK_PRESENCE_REQUIRED
LIBSSH2_SK_VERIFICATION_REQUIRED


ctypedef struct_stat libssh2_struct_stat
Expand Down
123 changes: 84 additions & 39 deletions ssh2/error_codes.c

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

3 changes: 3 additions & 0 deletions ssh2/error_codes.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,8 @@ cdef extern from "libssh2.h" nogil:
_LIBSSH2_ERROR_RANDGEN "LIBSSH2_ERROR_RANDGEN"
_LIBSSH2_ERROR_MISSING_USERAUTH_BANNER "LIBSSH2_ERROR_MISSING_USERAUTH_BANNER"
_LIBSSH2_ERROR_ALGO_UNSUPPORTED "LIBSSH2_ERROR_ALGO_UNSUPPORTED"
_LIBSSH2_ERROR_MAC_FAILURE "LIBSSH2_ERROR_MAC_FAILURE"
_LIBSSH2_ERROR_HASH_INIT "LIBSSH2_ERROR_HASH_INIT"
_LIBSSH2_ERROR_HASH_CALC "LIBSSH2_ERROR_HASH_CALC"

_LIBSSH2CHANNEL_EAGAIN "LIBSSH2_ERROR_EAGAIN"
3 changes: 3 additions & 0 deletions ssh2/error_codes.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@ LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \
LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN
LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER
LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED
LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE
LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT
LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC
Loading