Skip to content

Upgrades #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 70 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c0482d2
CI cfg minor changes
pkittenis Dec 3, 2022
14c3e9d
Updated cython version, updates for definitions.
pkittenis Jan 4, 2025
1211a4e
Updated language version
pkittenis Jan 4, 2025
95b26f5
Added include dirs
pkittenis Jan 4, 2025
6dcbe99
Updated embedded libssh2 to 1.11.1
pkittenis Jan 4, 2025
8dd862b
Updates for new libssh2 version
pkittenis Jan 4, 2025
bf1c02b
Updated openssl version to 3.4.0. Updated wheel build scripts.
pkittenis Jan 5, 2025
33eb7ea
Updated versioneer
pkittenis Jan 6, 2025
9468907
Added exception raising with error message handling function
pkittenis Jan 6, 2025
d7bb069
Updated session tests and base
pkittenis Jan 10, 2025
e0865d3
Updated embedded server
pkittenis Jan 10, 2025
be28f0e
Utils updates
pkittenis Jan 10, 2025
f31f689
Minor
pkittenis Jan 10, 2025
8c977ff
Updated channel functions, setup.cfg
pkittenis Jan 10, 2025
e7b8625
Updated docstrings
pkittenis Jan 10, 2025
10e9a39
Refactored tests into unit and CI integration tests
pkittenis Jan 11, 2025
81550d7
Cleanup
pkittenis Jan 11, 2025
474f8d6
Updated ci cfg, manifest
pkittenis Jan 11, 2025
67dc940
Util fixes
pkittenis Jan 11, 2025
323f116
Updated session, utils
pkittenis Jan 11, 2025
aaa568d
Updated exc handling
pkittenis Jan 11, 2025
6ad6d73
Added non-blocking multi exec multi channel from single session test
pkittenis Jan 12, 2025
091adc1
Minor updates.
pkittenis Jan 12, 2025
22e5a55
Updated CI cfg
pkittenis Jan 12, 2025
6aa1dd6
Updated CI cfg
pkittenis Jan 12, 2025
26de8d2
Updated CI cfg
pkittenis Jan 12, 2025
bcb852c
Updated CI cfg
pkittenis Jan 12, 2025
d77c6b8
Updated CI cfg
pkittenis Jan 12, 2025
8a8ce8e
Updated CI cfg
pkittenis Jan 12, 2025
e335458
Updated CI cfg
pkittenis Jan 12, 2025
bfa56ef
Updated docs
pkittenis Jan 12, 2025
a2f0caf
Added checking for socket before attempting to get session methods. A…
pkittenis Jan 12, 2025
8722a6a
Updated cfg
pkittenis Jan 12, 2025
5b7b148
Updated cfg
pkittenis Jan 12, 2025
e461c99
Updated cfg
pkittenis Jan 12, 2025
836ddeb
Updated cfg
pkittenis Jan 12, 2025
2b5fbfb
Updated cfg
pkittenis Jan 12, 2025
185de01
Updated cfg
pkittenis Jan 12, 2025
e89c666
Updated cfg
pkittenis Jan 12, 2025
6f9a0df
Updated cfg
pkittenis Jan 12, 2025
6106ef4
Updated cfg
pkittenis Jan 12, 2025
1a3ba0c
Updated cfg
pkittenis Jan 12, 2025
8f26126
Updated cfg
pkittenis Jan 12, 2025
5862a0d
Updated cfg
pkittenis Jan 12, 2025
70dc662
Updated cfg
pkittenis Jan 12, 2025
c873f86
Updated cfg
pkittenis Jan 12, 2025
14ffb19
Updated ci cfg
pkittenis Jan 12, 2025
9e898f4
Updated ci cfg
pkittenis Jan 12, 2025
fdebfb4
Revert "Added checking for socket before attempting to get session me…
pkittenis Jan 12, 2025
3e2586b
Updated sshd template
pkittenis Jan 12, 2025
a6332f6
Reapply "Added checking for socket before attempting to get session m…
pkittenis Jan 12, 2025
257932f
Updated appveyor cfg
pkittenis Jan 12, 2025
64a9e96
Updated cfg
pkittenis Jan 12, 2025
433217d
Updated cfg
pkittenis Jan 12, 2025
4426989
Updated cfg
pkittenis Jan 12, 2025
7e51514
Updated cfg
pkittenis Jan 12, 2025
2307462
Updated cfg
pkittenis Jan 12, 2025
24936fd
Updated OSX build script, appveyor cfg, embedded build script, ci cfg
pkittenis Jan 12, 2025
74bfb4a
Updated appveyor cfg
pkittenis Jan 12, 2025
8653692
Updated appveyor cfg
pkittenis Jan 12, 2025
60b8d6a
Updated changelog
pkittenis Jan 12, 2025
fc34120
Updated osx cfg
pkittenis Jan 12, 2025
729c989
Updated CI cfg
pkittenis Jan 12, 2025
6b168a3
Updated arm manylinux
pkittenis Jan 12, 2025
7834405
Updated CI cfg
pkittenis Jan 12, 2025
095f62b
Updated CI cfg
pkittenis Jan 12, 2025
69a71e7
Updated appveyor cfg
pkittenis Jan 12, 2025
a073360
Updated appveyor cfg
pkittenis Jan 12, 2025
28f6581
Updated appveyor cfg
pkittenis Jan 12, 2025
90d145e
Updated appveyor cfg
pkittenis Jan 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 4 additions & 15 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ environment:
PYTHON_DEF: "C:\\Python38-x64"
PYTHON_VERSION: "3.8"
# Python versions to build wheels for
PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64 C:\Python39-x64 C:\Python310-x64
PYTHONVERS: C:\Python38-x64 C:\Python39-x64 C:\Python310-x64 C:\Python311-x64 C:\Python312-x64
PYTHON_ARCH: "64"
MSVC: "Visual Studio 16 2019"

Expand All @@ -46,7 +46,7 @@ install:
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
- set OPENSSL_DIR="C:\OpenSSL-v11-Win%PYTHON_ARCH%"
- set OPENSSL_DIR="C:\OpenSSL-v34-Win64"
- set VCLIBDIR=%WINDIR%\System32
- cp %VCLIBDIR%/vcruntime*.dll ssh2/
- cp %VCLIBDIR%/msvcp*.dll ssh2/
Expand All @@ -65,27 +65,16 @@ install:
- 7z x ci\appveyor\zlib1211.zip

build_script:
- dir %OPENSSL_DIR%\lib\VC\x64\MD
- ci\\appveyor\\build_zlib.bat
- 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 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
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build_ext
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py install
- ps: ls ssh2

test_script:
- cd dist
- for %%I in (%PYTHONVERS%) do %%I\python.exe -c "from ssh2.session import Session; Session()"
- cd ..

after_test:
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py bdist_wheel
- mv dist/* .
- ci\\appveyor\\build_package.bat

artifacts:
- path: "*.whl"
Expand Down
53 changes: 27 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,26 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
version: 2.1

orbs:
python: circleci/[email protected]

jobs:
python_test:
parameters:
python_ver:
type: string
default: "3.6"
default: "3.10"
docker:
- image: circleci/python:<< parameters.python_ver >>
- image: cimg/python:<< parameters.python_ver >>
steps:
- checkout
- python/load-cache:
dependency-file: requirements_dev.txt
key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >>
- run:
name: Deps
command: |
sudo apt-get update
sudo apt-get install cmake openssh-server
pip install -r requirements_dev.txt
- python/save-cache:
dependency-file: requirements_dev.txt
key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >>
- run:
command: |
pip uninstall -y cython
python setup.py build_ext --inplace
eval "$(ssh-agent -s)"
name: Build
Expand All @@ -50,20 +43,32 @@ jobs:
set -x
ls -lhtr ssh2/
pwd
pytest tests
python -m pytest tests
name: Test
- run:
command: |
python -m pytest ci/integration_tests
name: Integration
- run:
command: |
flake8 ssh2
name: Flake
- run:
command: |
python setup.py sdist
cd dist; pip install *; python -c 'from ssh2.session import Session; Session()'; cd ..
name: Sdist Install
- run:
command: |
cd doc
make html
cd ..
name: Test
name: Docs

osx:
parameters:
xcode_ver:
type: string
default: "11.6.0"
macos:
xcode: << parameters.xcode_ver >>
environment:
Expand All @@ -75,6 +80,8 @@ jobs:
name: deps
command: |
brew install cmake git-lfs python libssh2
brew link --force openssl
brew link --force libssh2
pip3 install twine
which twine
- run:
Expand All @@ -90,12 +97,9 @@ jobs:

manylinux-x86_64:
machine:
image: ubuntu-2004:202201-02
image: ubuntu-2004:current
steps: &manylinux-steps
- checkout
- python/load-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Git LFS
command: |
Expand All @@ -110,11 +114,7 @@ jobs:
pip install -U pip
pip install twine
which twine
which python
which python3
- python/save-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Build Wheels
command: |
Expand All @@ -134,22 +134,22 @@ jobs:

manylinux2014-aarch64:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2004:current
resource_class: arm.medium
steps: *manylinux-steps

workflows:
version: 2.1
version: 2
main:
jobs:
- python_test:
matrix:
parameters:
python_ver:
- "3.6"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
filters:
tags:
ignore: /.*/
Expand All @@ -166,7 +166,8 @@ workflows:
parameters:
xcode_ver:
- "14.0.0"
- "13.1.0"
- "15.0.0"
- "16.0.0"
filters:
tags:
only: /.*/
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ zlib1211.zip filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
ci/docker/manylinux/libssh2.tar.gz filter=lfs diff=lfs merge=lfs -text
ci/docker/manylinux/cmake-2.8.11.1-5.4.x86_64.rpm filter=lfs diff=lfs merge=lfs -text
ssh2/_version.py export-subst
18 changes: 18 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
Change Log
=============

1.1.0 (unreleased)
++++++++++++++++++

Changes
--------

* Support for Python >=3.12.
* Upgraded embedded and wheel ``libssh2`` to ``1.11.1``.
* Upgraded wheel OpenSSL to 3.4.0.
* Removed testing for Python versions <3.8.

Packaging
----------

* Added binary wheels for Python versions 3.11, 3.12.
* Added OSX 12.0 and 13.0 wheels, Apple Silicon.


1.0.0
++++++

Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ recursive-exclude docker *
include _setup_libssh2.py
include versioneer.py
include ssh2/_version.py
recursive-exclude .circleci
recursive-exclude .circleci *
recursive-exclude ci *
include LICENSE
include ssh2/*.pyx
include ssh2/*.pxd
Expand Down
10 changes: 6 additions & 4 deletions _setup_libssh2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import os

from sys import stderr
from subprocess import check_call
from glob import glob
from shutil import copy2
from subprocess import check_call

from sys import stderr


def build_ssh2():
Expand All @@ -27,12 +27,14 @@ def build_ssh2():
return
if os.path.exists('/usr/local/opt/openssl'):
os.environ['OPENSSL_ROOT_DIR'] = '/usr/local/opt/openssl'
if os.path.exists('/opt/homebrew/opt/openssl'):
os.environ['OPENSSL_ROOT_DIR'] = '/opt/homebrew/opt/openssl'

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

os.chdir('build_dir')
check_call('cmake ../libssh2/libssh2 -DBUILD_SHARED_LIBS=ON \
check_call('cmake ../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)
Expand Down
17 changes: 17 additions & 0 deletions ci/appveyor/build_package.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
IF NOT "%APPVEYOR_REPO_TAG%" == "true" (exit 0)

dir ssh2/

for %%I in (%PYTHONVERS%) do %%I\python.exe -V
for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build_ext
for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build
for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py install

dir ssh2/

cd dist
for %%I in (%PYTHONVERS%) do %%I\python.exe -c "from ssh2.session import Session; Session()"
cd ..

for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py bdist_wheel
mv dist/* .
6 changes: 3 additions & 3 deletions ci/appveyor/build_ssh2.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mkdir build_dir
cd build_dir

ECHO "Building with platform %MSVC%"
cmake ..\libssh2\libssh2 -G "NMake Makefiles" ^
cmake ..\libssh2 -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCRYPTO_BACKEND=OpenSSL ^
-G"%MSVC%" ^
Expand All @@ -16,8 +16,8 @@ cmake ..\libssh2\libssh2 -G "NMake Makefiles" ^
-DOPENSSL_ROOT_DIR=%OPENSSL_DIR%
)

cp %OPENSSL_DIR%\lib\VC\libcrypto%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
cp %OPENSSL_DIR%\lib\VC\x64\MD\libcrypto.lib %APPVEYOR_BUILD_FOLDER%
cp %OPENSSL_DIR%\lib\VC\x64\MD\libssl.lib %APPVEYOR_BUILD_FOLDER%

cmake --build . --config Release
cd ..
6 changes: 4 additions & 2 deletions ci/build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# 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/cp310-cp310/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 @@ -29,6 +29,8 @@ done

# Install packages and test
for PYBIN in $(ls -1d /opt/python/*/bin | grep -v cpython); do
# for PYBIN in `ls -1d /opt/python/cp310-cp310/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()')
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh2.session import Session; Session()' &&
echo "Import sanity check succeeded.")
done
6 changes: 3 additions & 3 deletions ci/docker/manylinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
FROM quay.io/pypa/manylinux2010_x86_64

ENV OPENSSL openssl-1.1.1q
ENV OPENSSL openssl-3.4.0
ENV SYSTEM_LIBSSH2 1
ENV LIBSSH2_VERSION 1.10.0
ENV LIBSSH2_VERSION 1.11.1

RUN yum install zlib-devel -y
RUN yum install zlib-devel perl-IPC-Cmd -y

ADD libssh2-${LIBSSH2_VERSION}.tar.gz libssh2-${LIBSSH2_VERSION}.tar.gz
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
Expand Down
6 changes: 3 additions & 3 deletions ci/docker/manylinux/Dockerfile.2014_x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
FROM quay.io/pypa/manylinux2014_x86_64

ENV OPENSSL openssl-1.1.1q
ENV OPENSSL openssl-3.4.0
ENV SYSTEM_LIBSSH2 1
ENV LIBSSH2_VERSION 1.10.0
ENV LIBSSH2_VERSION 1.11.1

RUN yum install zlib-devel -y
RUN yum install zlib-devel perl-IPC-Cmd -y

ADD libssh2-${LIBSSH2_VERSION}.tar.gz libssh2-${LIBSSH2_VERSION}.tar.gz
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions ci/docker/manylinux/Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -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.1q
ENV OPENSSL openssl-3.4.0
ENV SYSTEM_LIBSSH2 1
ENV LIBSSH2_VERSION 1.10.0
ENV LIBSSH2_VERSION 1.11.1

RUN yum install zlib-devel -y

Expand Down
3 changes: 0 additions & 3 deletions ci/docker/manylinux/libssh2-1.10.0.tar.gz

This file was deleted.

3 changes: 3 additions & 0 deletions ci/docker/manylinux/libssh2-1.11.1.tar.gz
Git LFS file not shown
File renamed without changes.
Loading