Skip to content

Commit 84d76ca

Browse files
authored
Circleci (#12)
Upgrade libssh to 0.9.4 Added tests and manylinux builds on CircleCI Updated manylinux builds to 2010
1 parent b82ab39 commit 84d76ca

File tree

372 files changed

+74875
-29911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+74875
-29911
lines changed

Diff for: .appveyor.yml

+28-52
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,29 @@ environment:
33
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
44
# /E:ON and /V:ON options are not enabled in the batch script intepreter
55
# See: http://stackoverflow.com/a/13751649/163740
6-
CMD_IN_ENV: "cmd /E:ON /V:ON /C %APPVEYOR_BUILD_FOLDER%\\ci\\appveyor\\run_with_env.cmd"
6+
# CMD_IN_ENV: "cmd /E:ON /V:ON /C %APPVEYOR_BUILD_FOLDER%\\ci\\appveyor\\run_with_env.cmd"
77
PYTHONUNBUFFERED: 1
8-
EMBEDDED_LIB: 1
9-
OPENSSL_VER: 1.0.2l
8+
OPENSSL_VER: 1.1.0h
9+
SYSTEM_LIBSSH: 1
1010
PYPI_USER:
1111
secure: 2m0jy6JD/R9RExIosOT6YA==
1212
PYPI_PASS:
1313
secure: x+dF0A8BZUf2IrPNRN1O0w==
1414
matrix:
15-
- PYTHON: "C:\\Python27"
16-
PYTHON_VERSION: "2.7"
17-
PYTHON_ARCH: "32"
18-
MSVC: "Visual Studio 9"
19-
ARCH: i386
20-
21-
- PYTHON: "C:\\Python27-x64"
22-
PYTHON_VERSION: "2.7"
23-
PYTHON_ARCH: "64"
24-
MSVC: "Visual Studio 9"
25-
ARCH: x64_86
26-
27-
- PYTHON: "C:\\Python34"
28-
PYTHON_VERSION: "3.4"
29-
PYTHON_ARCH: "32"
30-
MSVC: "Visual Studio 10"
31-
ARCH: i386
32-
33-
- PYTHON: "C:\\Python34-x64"
34-
PYTHON_VERSION: "3.4"
15+
- PYTHON: "C:\\Python36-x64"
16+
PYTHON_VERSION: "3.6"
3517
PYTHON_ARCH: "64"
36-
MSVC: "Visual Studio 10 Win64"
18+
MSVC: "Visual Studio 14 Win64"
3719
ARCH: x64_86
3820

39-
- PYTHON: "C:\\Python35"
40-
PYTHON_VERSION: "3.5"
41-
PYTHON_ARCH: "32"
42-
MSVC: "Visual Studio 14"
43-
ARCH: i386
44-
45-
- PYTHON: "C:\\Python35-x64"
46-
PYTHON_VERSION: "3.5"
21+
- PYTHON: "C:\\Python37-x64"
22+
PYTHON_VERSION: "3.7"
4723
PYTHON_ARCH: "64"
4824
MSVC: "Visual Studio 14 Win64"
4925
ARCH: x64_86
5026

51-
- PYTHON: "C:\\Python36"
52-
PYTHON_VERSION: "3.6"
53-
PYTHON_ARCH: "32"
54-
MSVC: "Visual Studio 14"
55-
ARCH: i386
56-
57-
- PYTHON: "C:\\Python36-x64"
58-
PYTHON_VERSION: "3.6"
27+
- PYTHON: "C:\\Python38-x64"
28+
PYTHON_VERSION: "3.8"
5929
PYTHON_ARCH: "64"
6030
MSVC: "Visual Studio 14 Win64"
6131
ARCH: x64_86
@@ -92,31 +62,37 @@ install:
9262
# target Python version and architecture
9363
- "%CMD_IN_ENV% pip install -r requirements_dev.txt"
9464
- "%CMD_IN_ENV% pip install -U wheel setuptools twine"
95-
- git submodule update --init --recursive
9665

9766
# .c files need to be generated on Windows to handle platform
9867
# specific code.
9968
# Fix version used by versioneer to current git tag so the generated .c files
10069
# do not cause a version change.
10170
- python ci/appveyor/fix_version.py .
10271
- mv -f .git .git.bak
103-
- appveyor DownloadFile http://zlib.net/zlib1211.zip
104-
- 7z x zlib1211.zip
105-
- appveyor DownloadFile https://indy.fulgan.com/SSL/openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip
106-
- 7z x openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip
107-
- cp ssleay32.dll ssh2\
108-
- cp libeay32.dll ssh2\
109-
- ps: ls ssh2
72+
- IF NOT "%PYTHON_VERSION%" == "2.7" (
73+
7z x ci\appveyor\zlib1211.zip
74+
7z x ci\appveyor\kfw-4.1-src.zip
75+
appveyor DownloadFile https://indy.fulgan.com/SSL/Archive/Experimental/openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017.zip
76+
7z x openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017.zip
77+
cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libssl-1_1-x%PYTHON_ARCH%.dll ssh\ || cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libssl-1_1.dll ssh\
78+
cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libcrypto-1_1-x%PYTHON_ARCH%.dll ssh\ || cp openssl-%OPENSSL_VER%-x%PYTHON_ARCH%-VC2017\libcrypto-1_1.dll ssh\
79+
)
80+
- ps: ls ssh
81+
- ps: ls
11082

11183
build_script:
84+
- "%CMD_IN_ENV% ci\\appveyor\\build_krb.bat"
11285
- "%CMD_IN_ENV% ci\\appveyor\\build_zlib.bat"
113-
- "%CMD_IN_ENV% ci\\appveyor\\build_ssh2.bat"
114-
- rm -f ssh2/*.c
86+
- "%CMD_IN_ENV% ci\\appveyor\\build_ssh.bat"
87+
- rm -f ssh/*.c
88+
- "%CMD_IN_ENV% python setup.py build_ext -I ci/appveyor/include"
11589
- "%CMD_IN_ENV% python setup.py build"
116-
- "%CMD_IN_ENV% python setup.py build_ext -i"
90+
- "%CMD_IN_ENV% python setup.py install"
11791

11892
test_script:
119-
- python -c "from ssh2.session import Session; Session()"
93+
- cd dist
94+
- python ..\\ci\\appveyor\\import_test.py
95+
- cd ..
12096

12197
after_test:
12298
# If tests are successful, create binary packages for the project.

Diff for: .circleci/config.yml

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
version: 2.1
2+
3+
orbs:
4+
python: circleci/[email protected]
5+
6+
jobs:
7+
python_test:
8+
parameters:
9+
python_ver:
10+
type: string
11+
default: "3.6"
12+
docker:
13+
- image: circleci/python:<< parameters.python_ver >>
14+
steps:
15+
- checkout
16+
- python/load-cache:
17+
dependency-file: requirements_dev.txt
18+
key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >>
19+
- run:
20+
name: Deps
21+
command: |
22+
sudo apt-get install cmake openssh-server
23+
pip install flake8 jinja2 sphinx sphinx_rtd_theme pytest pytest-rerunfailures
24+
- python/save-cache:
25+
dependency-file: requirements_dev.txt
26+
key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >>
27+
- run:
28+
command: |
29+
python setup.py build_ext --inplace
30+
eval "$(ssh-agent -s)"
31+
name: Build
32+
- run:
33+
command: |
34+
ls -lhtr ssh/
35+
pwd
36+
pytest tests
37+
flake8 ssh
38+
python setup.py sdist
39+
cd dist; pip install *; cd ..
40+
name: Test
41+
osx:
42+
macos:
43+
xcode: 11.6.0
44+
environment:
45+
HOMEBREW_NO_AUTO_UPDATE: 1
46+
PYENV: 3.6.11
47+
SYSTEM_LIBSSH: 1
48+
steps:
49+
- checkout
50+
- run:
51+
name: deps
52+
command: |
53+
brew install cmake git-lfs
54+
pip install twine
55+
which twine
56+
manylinux:
57+
machine:
58+
image: ubuntu-1604:201903-01
59+
steps:
60+
- checkout
61+
- python/load-cache:
62+
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
63+
dependency-file: requirements_dev.txt
64+
- run:
65+
name: Git LFS
66+
command: |
67+
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
68+
sudo apt-get install git-lfs
69+
git lfs install
70+
git lfs pull
71+
- run:
72+
name: Deps
73+
command: |
74+
sudo apt-get install python-pip
75+
pip install -U pip
76+
pip install twine
77+
which twine
78+
- python/save-cache:
79+
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
80+
dependency-file: requirements_dev.txt
81+
- run:
82+
name: Build Wheels
83+
command: |
84+
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then
85+
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin;
86+
fi
87+
./ci/travis/build-manylinux.sh
88+
- run:
89+
name: Upload Wheels
90+
command: twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheelhouse/*
91+
workflows:
92+
version: 2.1
93+
main:
94+
jobs:
95+
- python_test:
96+
matrix:
97+
parameters:
98+
python_ver:
99+
- "3.6"
100+
- "3.7"
101+
- "3.8"
102+
- manylinux:
103+
context: Docker
104+
requires:
105+
- python_test
106+
filters:
107+
branches:
108+
ignore: /.*/
109+
tags:
110+
only: /.*/
111+
# - osx
112+
# filters:
113+
# tags:
114+
# only: /.*/

Diff for: .gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.tar.gz filter=lfs diff=lfs merge=lfs -text
2+
*.rpm filter=lfs diff=lfs merge=lfs -text

Diff for: .gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
dist
44
build
55
*~
6-
*.so
6+
*.so*
7+
src
8+
libssh/compile_commands.json

Diff for: .travis.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
language: python
2-
cache: pip
2+
cache:
3+
- pip
4+
- directories:
5+
- "$HOME/.pyenv"
6+
- "$HOME/Library/Caches/Homebrew"
7+
- "$HOME/.git/lfs"
38
notifications:
49
email: false
510
sudo: required
611
services:
712
- docker
813
python:
914
- 2.7
10-
- 3.4
11-
- 3.5
1215
- 3.6
16+
- 3.7
17+
- 3.8
1318
addons:
1419
apt:
1520
packages:
@@ -22,11 +27,10 @@ install:
2227
- python setup.py build_ext --inplace
2328
- eval "$(ssh-agent -s)"
2429
script:
25-
- nosetests
30+
- pytest tests
2631
- flake8 ssh
2732
- python setup.py sdist
2833
- cd dist; pip install *; cd ..
29-
- cd doc; make html; cd ..
3034
jobs:
3135
include:
3236
- stage: build wheels

Diff for: Changelog.rst

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Change Log
22
=============
33

4+
0.4.0
5+
+++++++
6+
7+
Changes
8+
--------
9+
10+
* Updated error handling code to check for SSH status codes and correctly raise exceptions or return error code with no exception in non-blocking mode.
11+
* Updated embedded libssh to ``0.9.4``.
12+
* Added known host session API method implementations.
13+
14+
Packaging
15+
----------
16+
17+
* Added manylinux 2010 binary wheels.
18+
419
0.3.0
520
++++++++
621

Diff for: README.rst

+17-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ Bindings for libssh_ C library.
99
.. image:: https://img.shields.io/pypi/v/ssh-python.svg
1010
:target: https://pypi.python.org/pypi/ssh-python
1111
:alt: Latest Version
12+
.. image:: https://circleci.com/gh/ParallelSSH/ssh-python/tree/master.svg?style=shield
13+
:target: https://circleci.com/gh/ParallelSSH/ssh-python/tree/master
14+
.. image:: https://img.shields.io/pypi/wheel/ssh-python.svg
15+
:target: https://pypi.python.org/pypi/ssh-python
16+
.. image:: https://img.shields.io/pypi/pyversions/ssh-python.svg
17+
:target: https://pypi.python.org/pypi/ssh-python
1218

1319
Installation
1420
_____________
1521

16-
Currently only installation from source is provided. Binary wheels to follow.
22+
Binary wheels are provided for Linux, OSX and Windows wheels to follow.
1723

18-
To install from source, run the following:
1924

2025
.. code-block:: shell
2126
@@ -31,7 +36,8 @@ Prerequisites
3136
* OpenSSL *or* gcrypt library and development headers
3237
* Optionally Zlib library and development headers for compression
3338

34-
``Libssh`` source code is embedded in this project and will be built when installation is triggered per above instructions. Versions of ``libssh`` other than the one embedded in this project are not supported.
39+
``Libssh`` source code is embedded in this project and will be built when installation is triggered per above instructions.
40+
Versions of ``libssh`` other than the one embedded in this project are not supported.
3541

3642

3743
Quick Start
@@ -48,6 +54,7 @@ _____________
4854
from ssh.session import Session
4955
from ssh import options
5056
57+
# Linux only
5158
USERNAME = pwd.getpwuid(os.geteuid()).pw_name
5259
HOST = 'localhost'
5360
@@ -79,11 +86,14 @@ _________
7986

8087
The library uses `Cython`_ based native code extensions as wrappers to ``libssh``.
8188

82-
* Thread safe - GIL is released as much as possible
89+
* Thread safe - GIL released as much as possible
8390
* Very low overhead thin wrapper
84-
* Object oriented - memory freed automatically and safely as objects are garbage collected by Python
85-
* Use Python semantics where applicable, such as context manager and iterator support for opening and reading from channels and SFTP file handles
86-
* Raise errors as Python exceptions
91+
* Object oriented
92+
* Memory freed automatically and safely as objects are garbage collected by Python
93+
* Uses Python semantics where applicable
94+
* channel/file handle context manager support
95+
* channel/file handle iterator support
96+
* Raises low level C errors as Python exceptions
8797

8898

8999
.. _libssh: https://www.libssh.org

Diff for: _setup_libssh.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ def build_ssh():
2323
check_call(['make', '-j%s' % (cpu_count(),)])
2424
os.chdir('..')
2525

26-
for src in glob('src/src/libssh.so*'):
26+
for src in glob('src/lib/libssh.so*'):
2727
copy2(src, 'ssh/')

Diff for: ci/appveyor/build_krb.bat

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set KRB_INSTALL_DIR=%APPVEYOR_HOME_DIR%/src/lib
2+
set CPU=AMD64
3+
setenv /x64 /release
4+
cd kfw-4.1/src
5+
nmake
6+
nmake install
7+
cd ../..

0 commit comments

Comments
 (0)