Skip to content

Commit

Permalink
Libssh2 upg (#179)
Browse files Browse the repository at this point in the history
* Upgraded libssh2 to 1.10.0.
* Regenerated with latest cython.
* Updated docker files for new libssh2 and openssl versions. Removed obsolete file.
* Updated readthedocs config.
* Updated setup.py, CI cfgs, CI scripts.
* Updated Changelog.
  • Loading branch information
pkittenis committed Jul 31, 2022
1 parent 0064a2d commit 4b0a7a8
Show file tree
Hide file tree
Showing 583 changed files with 212,304 additions and 6,306 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ build_script:
- for %%I in (%PYTHONVERS%) do cp C:/zlib/lib/zlibstatic.lib %%I/libs/
- for %%I in (%PYTHONVERS%) do ls %%I/libs/
- ci\\appveyor\\build_ssh2.bat
- for %%I in (%PYTHONVERS%) do cp src/src/libssh2.lib %%I/libs/ || cp src/src/Release/libssh2.lib %%I/libs/
- for %%I in (%PYTHONVERS%) do cp build_dir/src/libssh2.lib %%I/libs/ || cp build_dir/src/Release/libssh2.lib %%I/libs/
- rm -f ssh2/*.c
- ps: ls ssh2
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
Expand Down
12 changes: 4 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -34,6 +34,7 @@ jobs:
- run:
name: Deps
command: |
sudo apt-get update
sudo apt-get install cmake openssh-server
pip install -r requirements_dev.txt
- python/save-cache:
Expand Down Expand Up @@ -89,7 +90,7 @@ jobs:
manylinux-x86_64:
machine:
image: ubuntu-1604:201903-01
image: ubuntu-2004:202201-02
steps: &manylinux-steps
- checkout
- python/load-cache:
Expand All @@ -106,7 +107,6 @@ jobs:
name: Deps
command: |
sudo apt-get install python3-pip
pyenv global 3.7.0 || pyenv global 3.9.1
pip install -U pip
pip install twine
which twine
Expand Down Expand Up @@ -145,7 +145,6 @@ workflows:
parameters:
python_ver:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
Expand All @@ -164,11 +163,8 @@ workflows:
matrix:
parameters:
xcode_ver:
- "14.0.0"
- "13.1.0"
- "13.0.0"
- "12.5.1"
- "11.6.0"
- "11.1.0"
filters:
tags:
only: /.*/
Expand Down
8 changes: 0 additions & 8 deletions .environment.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @pkittenis
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dist
build
*~
*.so
src
build_dir
wheelhouse
.idea/
ssh2/libssh2.so*
Expand Down
11 changes: 8 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
conda:
file: .environment.yml
version: 2
build:
apt_packages:
- cmake
- openssl
python:
setup_py_install: true
install:
- method: pip
path: .
17 changes: 17 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Change Log
=============

1.0.0
++++++

Changes
--------

* Upgraded embedded and wheel libssh2 to 1.10.0.
* Upgraded wheel OpenSSL to 1.1.1q.
* Added testing for Python 3.10.
* Removed testing for Python 3.7.

Packaging
----------

* Added OSX 12.0 wheels.
* Removed OSX <= 10.0 wheels.

0.27.0
++++++

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ recursive-exclude docker *
include _setup_libssh2.py
include versioneer.py
include ssh2/_version.py
exclude .travis.yml
recursive-exclude .circleci
include LICENSE
include ssh2/*.pyx
include ssh2/*.pxd
Expand Down
11 changes: 5 additions & 6 deletions _setup_libssh2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from subprocess import check_call
from glob import glob
from shutil import copy2
from multiprocessing import cpu_count


def build_ssh2():
Expand All @@ -29,16 +28,16 @@ def build_ssh2():
if os.path.exists('/usr/local/opt/openssl'):
os.environ['OPENSSL_ROOT_DIR'] = '/usr/local/opt/openssl'

if not os.path.exists('src'):
os.mkdir('src')
if not os.path.exists('build_dir'):
os.mkdir('build_dir')

os.chdir('src')
check_call('cmake ../libssh2 -DBUILD_SHARED_LIBS=ON \
os.chdir('build_dir')
check_call('cmake ../libssh2/libssh2 -DBUILD_SHARED_LIBS=ON \
-DENABLE_ZLIB_COMPRESSION=ON -DENABLE_CRYPT_NONE=ON \
-DENABLE_MAC_NONE=ON -DCRYPTO_BACKEND=OpenSSL',
shell=True, env=os.environ)
check_call('cmake --build . --config Release', shell=True, env=os.environ)
os.chdir('..')

for src in glob('src/src/libssh2.so*'):
for src in glob('build_dir/src/libssh2.so*'):
copy2(src, 'ssh2/')
6 changes: 3 additions & 3 deletions ci/appveyor/build_ssh2.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mkdir src
cd src
mkdir build_dir
cd build_dir

ECHO "Building with platform %MSVC%"
cmake ..\libssh2 -G "NMake Makefiles" ^
cmake ..\libssh2\libssh2 -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCRYPTO_BACKEND=OpenSSL ^
-G"%MSVC%" ^
Expand Down
10 changes: 5 additions & 5 deletions ci/build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -xe
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -21,18 +21,18 @@ docker_files=("ci/docker/manylinux/Dockerfile" "ci/docker/manylinux/Dockerfile.2
rm -rf build ssh2/libssh2.* ssh2/*.so
python ci/appveyor/fix_version.py .

if [[ `uname -m` == "aarch64" ]]; then
if [[ $(uname -m) == "aarch64" ]]; then
docker_tag="${docker_tag}:aarch64"
docker_files=("ci/docker/manylinux/Dockerfile.aarch64")
fi

for docker_file in ${docker_files[@]}; do
for docker_file in "${docker_files[@]}"; do
if [[ ${docker_file} == "ci/docker/manylinux/Dockerfile_2014_x86_64" ]]; then
docker_tag = "${docker_tag}:2014_x86_64"
docker_tag="${docker_tag}:2014_x86_64"
fi
docker pull $docker_tag || echo
docker build --pull --cache-from $docker_tag ci/docker/manylinux -t $docker_tag -f ${docker_file}
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then docker push $docker_tag; fi
docker run --rm -v `pwd`:/io $docker_tag /io/ci/build-wheels.sh
docker run --rm -v "$(pwd)":/io $docker_tag /io/ci/build-wheels.sh
ls wheelhouse/
done
6 changes: 0 additions & 6 deletions ci/build-ssh2.sh

This file was deleted.

16 changes: 6 additions & 10 deletions ci/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -xe
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,12 +15,10 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

echo "Travis tag: $TRAVIS_TAG"

# Compile wheels
# For testing
# for PYBIN in `ls -1d /opt/python/cp36-cp36m/bin | grep -v cpython`; do
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
for PYBIN in $(ls -1d /opt/python/*/bin | grep -v cpython); do
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

Expand All @@ -30,9 +28,7 @@ for whl in wheelhouse/*.whl; do
done

# Install packages and test
if [[ ! -z "$TRAVIS_TAG" ]]; then
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
"${PYBIN}/pip" install ssh2-python --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh2.session import Session; Session()')
done
fi
for PYBIN in $(ls -1d /opt/python/*/bin | grep -v cpython); do
"${PYBIN}/pip" install ssh2-python --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh2.session import Session; Session()')
done
8 changes: 4 additions & 4 deletions ci/docker/manylinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,9 +15,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
FROM quay.io/pypa/manylinux2010_x86_64

ENV OPENSSL openssl-1.1.1g
ENV OPENSSL openssl-1.1.1q
ENV SYSTEM_LIBSSH2 1
ENV LIBSSH2_VERSION 1.9.0
ENV LIBSSH2_VERSION 1.10.0

RUN yum install zlib-devel -y

Expand All @@ -32,7 +32,7 @@ RUN cd ${OPENSSL} && \

# Libssh2
RUN mkdir -p build_libssh2 && cd build_libssh2 && \
cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-libssh2-${LIBSSH2_VERSION} \
cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-${LIBSSH2_VERSION} \
-DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCMAKE_INSTALL_PREFIX=/usr && \
cmake --build . --config Release --target install
Expand Down
8 changes: 4 additions & 4 deletions ci/docker/manylinux/Dockerfile.2014_x86_64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,9 +15,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
FROM quay.io/pypa/manylinux2014_x86_64

ENV OPENSSL openssl-1.1.1g
ENV OPENSSL openssl-1.1.1q
ENV SYSTEM_LIBSSH2 1
ENV LIBSSH2_VERSION 1.9.0
ENV LIBSSH2_VERSION 1.10.0

RUN yum install zlib-devel -y

Expand All @@ -32,7 +32,7 @@ RUN cd ${OPENSSL} && \

# Libssh2
RUN mkdir -p build_libssh2 && cd build_libssh2 && \
cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-libssh2-${LIBSSH2_VERSION} \
cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-${LIBSSH2_VERSION} \
-DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCMAKE_INSTALL_PREFIX=/usr && \
cmake --build . --config Release --target install
Expand Down
8 changes: 4 additions & 4 deletions ci/docker/manylinux/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -15,9 +15,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
FROM quay.io/pypa/manylinux2014_aarch64

ENV OPENSSL openssl-1.1.1g
ENV OPENSSL openssl-1.1.1q
ENV SYSTEM_LIBSSH2 1
ENV LIBSSH2_VERSION 1.9.0
ENV LIBSSH2_VERSION 1.10.0

RUN yum install zlib-devel -y

Expand All @@ -32,7 +32,7 @@ RUN cd ${OPENSSL} && \

# Libssh2
RUN mkdir -p build_libssh2 && cd build_libssh2 && \
cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-libssh2-${LIBSSH2_VERSION} \
cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-${LIBSSH2_VERSION} \
-DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCMAKE_INSTALL_PREFIX=/usr && \
cmake --build . --config Release --target install
Expand Down
3 changes: 3 additions & 0 deletions ci/docker/manylinux/libssh2-1.10.0.tar.gz
Git LFS file not shown
3 changes: 0 additions & 3 deletions ci/docker/manylinux/libssh2-1.9.0.tar.gz

This file was deleted.

10 changes: 0 additions & 10 deletions ci/install-ssh2.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ci/osx-wheel.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -xe
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down
8 changes: 8 additions & 0 deletions libssh2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ if(BUILD_TESTING)
add_subdirectory(tests)
endif()

option(LINT "Check style while building" OFF)
if(LINT)
add_custom_target(lint ALL
./ci/checksrc.sh
WORKING_DIRECTORY ${libssh2_SOURCE_DIR})
add_dependencies(libssh2 lint)
endif()

add_subdirectory(docs)

feature_summary(WHAT ALL)
Expand Down
4 changes: 3 additions & 1 deletion libssh2/COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* Copyright (c) 2005,2006 Mikhail Gusarov <[email protected]>
* Copyright (c) 2006-2007 The Written Word, Inc.
* Copyright (c) 2007 Eli Fant <[email protected]>
* Copyright (c) 2009-2014 Daniel Stenberg
* Copyright (c) 2009-2021 Daniel Stenberg
* Copyright (C) 2008, 2009 Simon Josefsson
* Copyright (c) 2000 Markus Friedl
* Copyright (c) 2015 Microsoft Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms,
Expand Down
1 change: 1 addition & 0 deletions libssh2/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
see NEWS
Loading

0 comments on commit 4b0a7a8

Please sign in to comment.