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
17 changes: 16 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# This file is part of ssh-python.
# 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
# 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 @@ -17,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"

install:
Expand Down
36 changes: 30 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# This file is part of ssh-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 @@ -72,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
- run:
name: sdist
Expand All @@ -93,7 +108,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 @@ -112,6 +128,12 @@ jobs:
command: |
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*

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

workflows:
version: 2.1
main:
Expand All @@ -126,19 +148,21 @@ workflows:
filters:
tags:
ignore: /.*/
- manylinux:
- manylinux-x86_64: &manylinux-wf
context: Docker
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- manylinux2014-aarch64: *manylinux-wf
- osx:
matrix:
parameters:
xcode_ver:
- "11.6.0"
- "11.1.0"
- "13.1.0"
- "13.0.0"
- "12.5.1"
context: Docker
filters:
tags:
Expand Down
15 changes: 15 additions & 0 deletions _setup_libssh.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# This file is part of ssh-python.
# 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
# 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
37 changes: 32 additions & 5 deletions ci/build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
#!/bin/bash -xe
# This file is part of ssh-python.
# 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
# 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/ssh-manylinux"
docker_files=("ci/docker/manylinux/Dockerfile" "ci/docker/manylinux/Dockerfile.2014_x86_64")

rm -rf local build ssh/libssh.* ssh/*.so
python ci/appveyor/fix_version.py .

docker pull $docker_tag || echo
docker build --pull --cache-from $docker_tag ci/docker/manylinux -t $docker_tag
if [[ -z "$CIRCLE_PR_NUMBER" ]]; then docker push $docker_tag; fi
docker run --rm -v `pwd`:/io $docker_tag /io/ci/build-wheels.sh
ls wheelhouse/
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
20 changes: 18 additions & 2 deletions ci/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
#!/bin/bash -xe
# This file is part of ssh-python.
# 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
# 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


# Compile wheels
rm -rf /io/build
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 @@ -12,7 +28,7 @@ for whl in wheelhouse/*.whl; do
done

# Install packages and test
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" install ssh-python --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh.session import Session; Session()')
done
16 changes: 16 additions & 0 deletions ci/build_ssh.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash -xe
# This file is part of ssh-python.
# 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
# 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


if [ -d /usr/local/opt/openssl ]; then
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl
Expand Down
7 changes: 4 additions & 3 deletions ci/docker/manylinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ FROM quay.io/pypa/manylinux2010_x86_64

ENV OPENSSL openssl-1.1.1g
ENV LIBSSH 0.9.6
ENV KRB 1.18.4
ENV SYSTEM_LIBSSH 1
ENV CFLAGS "-g0 -s"

RUN yum install zlib-devel cmake3 -y

ADD libssh-${LIBSSH}.tar.xz libssh.tar.xz
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
ADD krb5-1.18.4.tar.xz krb5-1.18.4.tar.xz
ADD krb5-${KRB}.tar.xz krb5-${KRB}.tar.xz

RUN tar -xzf ${OPENSSL}.tar.gz
# Openssl
Expand All @@ -18,7 +19,7 @@ RUN cd ${OPENSSL} && \
make -j6 && make install_sw

# Kerberos
RUN cd krb5-1.18.4.tar.xz/krb5-1.18.4/src && \
RUN cd krb5-${KRB}.tar.xz/krb5-${KRB}/src && \
./configure && \
make -j6 && \
make install
Expand All @@ -29,6 +30,6 @@ RUN mkdir -p build_libssh && cd build_libssh && \
-DWITH_GSS_API=ON && \
make -j6 install/strip

RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-1.18.4.tar.xz
RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-${KRB}.tar.xz

VOLUME /var/cache
35 changes: 35 additions & 0 deletions ci/docker/manylinux/Dockerfile.2014_x86_64
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM quay.io/pypa/manylinux2014_x86_64

ENV OPENSSL openssl-1.1.1g
ENV LIBSSH 0.9.6
ENV KRB 1.18.4
ENV SYSTEM_LIBSSH 1
ENV CFLAGS "-g0 -s"

RUN yum install zlib-devel cmake3 -y

ADD libssh-${LIBSSH}.tar.xz libssh.tar.xz
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
ADD krb5-${KRB}.tar.xz krb5-${KRB}.tar.xz

RUN tar -xzf ${OPENSSL}.tar.gz
# Openssl
RUN cd ${OPENSSL} && \
./config --prefix=/usr --openssldir=/usr/openssl threads shared && \
make -j6 && make install_sw

# Kerberos
RUN cd krb5-${KRB}.tar.xz/krb5-${KRB}/src && \
./configure && \
make -j6 && \
make install

# Libssh
RUN mkdir -p build_libssh && cd build_libssh && \
cmake3 ../libssh.tar.xz/libssh-${LIBSSH} -DCMAKE_BUILD_TYPE=Release \
-DWITH_GSS_API=ON && \
make -j6 install/strip

RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-${KRB}.tar.xz

VOLUME /var/cache
36 changes: 36 additions & 0 deletions ci/docker/manylinux/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM quay.io/pypa/manylinux2014_aarch64

ENV OPENSSL openssl-1.1.1g
ENV LIBSSH 0.9.6
ENV KRB 1.18.4
ENV SYSTEM_LIBSSH 1
ENV CFLAGS "-g0 -s"

RUN yum install epel-release -y
RUN yum install zlib-devel cmake3 -y

ADD libssh-${LIBSSH}.tar.xz libssh.tar.xz
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
ADD krb5-${KRB}.tar.xz krb5-${KRB}.tar.xz

RUN tar -xzf ${OPENSSL}.tar.gz
# Openssl
RUN cd ${OPENSSL} && \
./config --prefix=/usr --openssldir=/usr/openssl threads shared && \
make -j6 && make install_sw

# Kerberos
RUN cd krb5-${KRB}.tar.xz/krb5-${KRB}/src && \
./configure && \
make -j6 && \
make install

# Libssh
RUN mkdir -p build_libssh && cd build_libssh && \
cmake3 ../libssh.tar.xz/libssh-${LIBSSH} -DCMAKE_BUILD_TYPE=Release \
-DWITH_GSS_API=ON && \
make -j6 install/strip

RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-${KRB}.tar.xz

VOLUME /var/cache
18 changes: 17 additions & 1 deletion ci/osx-wheel.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash -xe
# This file is part of ssh-python.
# 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
# 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


pip3 install -U virtualenv
python3 -m virtualenv -p "$(which python3)" venv
Expand All @@ -20,7 +36,7 @@ ls -l wheels/*.whl
rm -f /usr/local/lib/libssh*
pip3 install -v wheels/*.whl
pwd; mkdir -p temp; cd temp; pwd
python3 -c "from ssh.session import Session; Session()" && echo "Import successfull"
python3 -c "from ssh.session import Session; Session()" && echo "Import successful"
cd ..; pwd
set +x
deactivate
Expand Down
Loading