Skip to content

Commit

Permalink
Source update (#162)
Browse files Browse the repository at this point in the history
* Removed support for libssh2<1.7.
* Removed native package scripts for obsolete libssh2 versions.
* Removed conda recipe.
* Moved find_eol files to ext
* Updated setup
* Updated gitignore.
* Check for session dealloc before deallocating agent.
* Updated sources
* Updated circle CI.
* Removed obsolete CI files.
* Added manylinux-2014 wheel builds for x86_64.
* Updated changelog
* Updated CI cfg
  • Loading branch information
pkittenis authored Nov 21, 2021
1 parent 9ec1b5e commit 83ca859
Show file tree
Hide file tree
Showing 58 changed files with 3,399 additions and 3,530 deletions.
20 changes: 16 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 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
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# 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
max_jobs: 5
build:
parallel: true
Expand All @@ -8,7 +23,6 @@ image: Visual Studio 2019
environment:
global:
PYTHONUNBUFFERED: 1
EMBEDDED_LIB: 1
SYSTEM_LIBSSH2: 1
PYPI_USER:
secure: WKF8ok0UPIgkA+isDUuHww==
Expand All @@ -18,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
PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64 C:\Python39-x64 C:\Python310-x64
PYTHON_ARCH: "64"
MSVC: "Visual Studio 16 2019"

Expand Down Expand Up @@ -56,9 +70,7 @@ build_script:
- 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/
- mv -f ssh2/find_eol.c .
- rm -f ssh2/*.c
- mv -f find_eol.c ssh2/
- ps: ls ssh2
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build_ext
Expand Down
74 changes: 29 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 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
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# 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
version: 2.1

orbs:
Expand Down Expand Up @@ -31,6 +46,7 @@ jobs:
name: Build
- run:
command: |
set -x
ls -lhtr ssh2/
pwd
pytest tests
Expand Down Expand Up @@ -71,10 +87,10 @@ jobs:
command: |
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheels/*
manylinux:
manylinux-x86_64:
machine:
image: ubuntu-1604:201903-01
steps:
steps: &manylinux-steps
- checkout
- python/load-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
Expand All @@ -89,7 +105,8 @@ jobs:
- run:
name: Deps
command: |
sudo apt-get install python-pip
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 All @@ -102,7 +119,7 @@ jobs:
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin;
fi
./ci/travis/build-manylinux.sh
./ci/build-manylinux.sh
- run:
name: sdist
command: python setup.py sdist
Expand All @@ -115,39 +132,7 @@ jobs:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- checkout
- python/load-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Git LFS
command: |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
git lfs pull
- run:
name: Deps
command: |
sudo apt-get install python3-pip
pip3 install -U pip
pip3 install twine
which twine
- python/save-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Build Wheels
command: |
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" ;
fi
./ci/travis/build-manylinux.sh
- run:
name: Upload Wheels
command: |
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*
steps: *manylinux-steps

workflows:
version: 2.1
Expand All @@ -160,27 +145,26 @@ workflows:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
filters:
tags:
ignore: /.*/
- manylinux:
context: Docker
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- manylinux2014-aarch64:
- manylinux-x86_64: &manylinux-wf
context: Docker
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- manylinux2014-aarch64: *manylinux-wf
- osx:
matrix:
parameters:
xcode_ver:
- "13.1.0"
- "13.0.0"
- "12.5.1"
- "11.6.0"
- "11.1.0"
filters:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ wheelhouse
.idea/
ssh2/libssh2.so*
doc/_build
venv
22 changes: 22 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
Change Log
=============

0.27.0
++++++

Changes
-------

* Python 3.10 support.

Fixes
-----

* Objects depending on ``ssh2.Session`` would sometimes cause segfault on interpreter shutdown.

Packaging
---------

* Added manylinux-2014 ARM (aarch64) wheel builds - #156 - Thanks @enaydanov
* Added manylinux-2014 x86_64 wheels for all currently available Python 3 versions.
* Added Windows 3.10 wheels.
* Added OSX 11.6, 11.5 and 11.4 wheels.


0.26.0
++++++

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ exclude .travis.yml
include LICENSE
include ssh2/*.pyx
include ssh2/*.pxd
include ssh2/find_eol*
include ssh2/ext/find_eol*
include ssh2/*.c
15 changes: 15 additions & 0 deletions _setup_libssh2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 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
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# 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
import os

from sys import stderr
Expand Down
12 changes: 0 additions & 12 deletions ci/binstar-push.py

This file was deleted.

38 changes: 38 additions & 0 deletions ci/build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash -xe
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 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
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# 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

docker_tag="parallelssh/ssh2-manylinux"
docker_files=("ci/docker/manylinux/Dockerfile" "ci/docker/manylinux/Dockerfile.2014_x86_64")

rm -rf build ssh2/libssh2.* ssh2/*.so
python ci/appveyor/fix_version.py .

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
if [[ ${docker_file} == "ci/docker/manylinux/Dockerfile_2014_x86_64" ]]; then
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
ls wheelhouse/
done
38 changes: 38 additions & 0 deletions ci/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash -xe
# This file is part of ssh2-python.
# Copyright (C) 2017-2021 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
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# 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

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
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
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
25 changes: 0 additions & 25 deletions ci/copy_abi_dist.py

This file was deleted.

Loading

0 comments on commit 83ca859

Please sign in to comment.