Skip to content

Commit 7f0f860

Browse files
author
Panos
committed
Merge with master
2 parents 50407e8 + c0e6b67 commit 7f0f860

Some content is hidden

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

61 files changed

+4326
-2247
lines changed

.appveyor.yml

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,23 @@ build:
33
parallel: true
44
verbosity: minimal
55
skip_branch_with_pr: true
6+
67
environment:
78
global:
89
PYTHONUNBUFFERED: 1
910
EMBEDDED_LIB: 1
1011
SYSTEM_LIBSSH2: 1
1112
PYPI_USER:
12-
secure: 2m0jy6JD/R9RExIosOT6YA==
13+
secure: WKF8ok0UPIgkA+isDUuHww==
1314
PYPI_PASS:
14-
secure: x+dF0A8BZUf2IrPNRN1O0w==
15-
matrix:
16-
- PYTHON: "C:\\Python36-x64"
17-
PYTHON_VERSION: "3.6"
18-
PYTHON_ARCH: "64"
19-
MSVC: "Visual Studio 14 Win64"
20-
ARCH: x64_86
21-
22-
- PYTHON: "C:\\Python37-x64"
23-
PYTHON_VERSION: "3.7"
24-
PYTHON_ARCH: "64"
25-
MSVC: "Visual Studio 14 Win64"
26-
ARCH: x64_86
27-
28-
- PYTHON: "C:\\Python38-x64"
29-
PYTHON_VERSION: "3.8"
30-
PYTHON_ARCH: "64"
31-
MSVC: "Visual Studio 14 Win64"
32-
ARCH: x64_86
15+
secure: uXkrTaPGSNQdXTJIt3aiyyGnH/ZtvWbDVIXdMrsgwROIJ0kprWp5crS6TAqqddyrFxd7Trrfjg/TjM1/Yx9JzfuKTfoJh1zyviWD/j2zibsycmJQy4Q+CrZ6uI3IRQwe/2ILKxGzLGFBWaqt6C8NaQnkKP+h7ptnPeVhy1+kaOaJowwrCKWje1Ag3CJCAJxPjSC8yl1nlM3DA1rAIk2C5SR4eQQLJeEpPSg3nDnxR4o4YjmA7ILD3OuM1Fbh5iue/rUvWzdt6QCxCbE4egtrCQ==
16+
# Default python version to run single commands with
17+
PYTHON_DEF: "C:\\Python36-x64"
18+
PYTHON_VERSION: "3.6"
19+
# Python versions to build wheels for
20+
PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64
21+
PYTHON_ARCH: "64"
22+
MSVC: "Visual Studio 14 Win64"
3323

3424
install:
3525
# If there is a newer build queued for the same PR, cancel this one.
@@ -48,49 +38,46 @@ install:
4838
- cp %VCLIBDIR%/msvcr*.dll ssh2/
4939
- cp %OPENSSL_DIR%/bin/*.dll ssh2/
5040

51-
# Prepend newly installed Python to the PATH of this build (this cannot be
52-
# done from inside the powershell script as it would require to restart
53-
# the parent CMD process).
54-
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
55-
56-
# Check that we have the expected version and architecture for Python
57-
- "python --version"
58-
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
59-
60-
- pip install -U wheel setuptools twine cython
41+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
42+
- for %%I in (%PYTHONVERS%) do %%I\Scripts\pip install -U wheel setuptools twine cython
6143

6244
# .c files need to be generated on Windows to handle platform
6345
# specific code.
6446
# Fix version used by versioneer to current git tag so the generated .c files
6547
# do not cause a version change.
66-
- python ci/appveyor/fix_version.py .
48+
- "%PYTHON_DEF%\\python.exe ci/appveyor/fix_version.py ."
6749
- mv -f .git .git.bak
6850
- 7z x ci\appveyor\zlib1211.zip
69-
- ps: ls ssh2
7051

7152
build_script:
7253
- ci\\appveyor\\build_zlib.bat
54+
- for %%I in (%PYTHONVERS%) do cp C:/zlib/lib/zlibstatic.lib %%I/libs/
55+
- for %%I in (%PYTHONVERS%) do ls %%I/libs/
7356
- ci\\appveyor\\build_ssh2.bat
57+
- for %%I in (%PYTHONVERS%) do cp src/src/libssh2.lib %%I/libs/ || cp src/src/Release/libssh2.lib %%I/libs/
58+
- mv -f ssh2/find_eol.c .
7459
- rm -f ssh2/*.c
75-
- python -V
76-
- python setup.py build_ext -I libssh2/include
77-
- python setup.py build
78-
- python setup.py install
60+
- mv -f find_eol.c ssh2/
61+
- ps: ls ssh2
62+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -V
63+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build_ext
64+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py build
65+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py install
7966
- ps: ls ssh2
8067

8168
test_script:
8269
- cd dist
83-
- python -c "from ssh2.session import Session; Session()"
70+
- for %%I in (%PYTHONVERS%) do %%I\python.exe -c "from ssh2.session import Session; Session()"
8471
- cd ..
8572

8673
after_test:
87-
# If tests are successful, create binary packages for the project.
88-
- python setup.py bdist_wheel
74+
- for %%I in (%PYTHONVERS%) do %%I\python.exe setup.py bdist_wheel
8975
- mv dist/* .
9076

9177
artifacts:
92-
# Archive the generated packages in the ci.appveyor.com build report.
9378
- path: "*.whl"
9479

9580
deploy_script:
81+
# Calling twine requires we set path
82+
- "SET PATH=%PYTHON_DEF%;%PYTHON_DEF%\\Scripts;%PATH%"
9683
- python ci/appveyor/pypi_upload.py *.whl

.circleci/config.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
version: 2.1
2+
3+
orbs:
4+
python: circleci/python@0.3.2
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 -r requirements_dev.txt
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 ssh2/
35+
pwd
36+
pytest tests
37+
flake8 ssh2
38+
python setup.py sdist
39+
cd dist; pip install *; python -c 'from ssh2.session import Session; Session()'; cd ..
40+
cd doc
41+
make html
42+
cd ..
43+
name: Test
44+
45+
osx:
46+
parameters:
47+
xcode_ver:
48+
type: string
49+
default: "11.6.0"
50+
macos:
51+
xcode: << parameters.xcode_ver >>
52+
environment:
53+
HOMEBREW_NO_AUTO_UPDATE: 1
54+
SYSTEM_LIBSSH2: 1
55+
steps:
56+
- checkout
57+
- run:
58+
name: deps
59+
command: |
60+
brew install cmake git-lfs python libssh2
61+
pip3 install twine
62+
which twine
63+
- run:
64+
name: Build Wheel
65+
command: |
66+
./ci/osx-wheel.sh
67+
- store_artifacts:
68+
path: wheels
69+
- run:
70+
name: Upload Wheel
71+
command: |
72+
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheels/*
73+
74+
manylinux:
75+
machine:
76+
image: ubuntu-1604:201903-01
77+
steps:
78+
- checkout
79+
- python/load-cache:
80+
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
81+
dependency-file: requirements_dev.txt
82+
- run:
83+
name: Git LFS
84+
command: |
85+
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
86+
sudo apt-get install git-lfs
87+
git lfs install
88+
git lfs pull
89+
- run:
90+
name: Deps
91+
command: |
92+
sudo apt-get install python-pip
93+
pip install -U pip
94+
pip install twine
95+
which twine
96+
- python/save-cache:
97+
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
98+
dependency-file: requirements_dev.txt
99+
- run:
100+
name: Build Wheels
101+
command: |
102+
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then
103+
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin;
104+
fi
105+
./ci/travis/build-manylinux.sh
106+
- run:
107+
name: sdist
108+
command: python setup.py sdist
109+
- run:
110+
name: Upload Wheels
111+
command: |
112+
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*
113+
114+
workflows:
115+
version: 2.1
116+
main:
117+
jobs:
118+
- python_test:
119+
matrix:
120+
parameters:
121+
python_ver:
122+
- "3.6"
123+
- "3.7"
124+
- "3.8"
125+
filters:
126+
tags:
127+
ignore: /.*/
128+
- manylinux:
129+
context: Docker
130+
filters:
131+
tags:
132+
only: /.*/
133+
branches:
134+
ignore: /.*/
135+
- osx:
136+
matrix:
137+
parameters:
138+
xcode_ver:
139+
- "11.6.0"
140+
- "11.1.0"
141+
filters:
142+
tags:
143+
only: /.*/
144+
branches:
145+
ignore: /.*/

.github/CONTRIBUTING.rst

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -201,42 +201,40 @@ install the development requirements first:
201201
202202
pip install -U -r requirements_dev.txt
203203
204-
Test suite is run via ``nosetests``. Simply calling ``nosetests`` in
204+
Test suite is run via ``pytest``.
205+
206+
Simply calling ``pytest tests`` in
205207
the Git repository's root directory will run all available tests.
206208

207-
To run an individual test suite, call nosetests on a particular test file.
209+
To run an individual test suite, call pytest on a particular test file.
208210

209211
.. code-block:: shell
210212
211-
nosetests tests/test_sftp.py
213+
pytest tests/test_sftp.py
212214
213215
The library does not use a logger and does not output anything.
214216

215-
.. code-block:: shell
216-
217-
nosetests --nologcapture
218-
219-
To have nosetests fall back to a PDB prompt on uncaught exceptions, call it
217+
To have pytest fall back to a PDB prompt on uncaught exceptions, call it
220218
like so:
221219

222220
.. code-block:: shell
223221
224-
nosetests --pdb
222+
pytest --pdb
225223
226224
If using manually set break points, via ``ipdb.set_trace()`` for example,
227-
call nosetests like so:
225+
call pytest like so:
228226

229227
.. code-block:: shell
230228
231-
nosetests -s
229+
pytest -s
232230
233231
to be able to fall back to an IPDB prompt.
234232

235233
Running an individual test within a test suite is also possible, for example:
236234

237235
.. code-block:: shell
238236
239-
nosetests tests/test_sftp.py:SFTPTestCase.test_readdir
237+
pytest tests/test_sftp.py::SFTPTestCase::test_readdir
240238
241239
will run the single test ``test_readdir`` in ``test_sftp.py``.
242240

@@ -284,8 +282,7 @@ In root directory of repository:
284282

285283
.. code-block:: shell
286284
287-
pip install sphinx
288-
(cd docs; rm -rf _build; make html)
285+
(cd docs; make html)
289286
290287
After building succeeds the documentation is available at ``doc/_build/html``.
291288

@@ -304,7 +301,7 @@ repository's root directory:
304301

305302
.. code-block:: shell
306303
307-
nosetests
304+
pytest tests
308305
309306
To ensure documentation builds correctly:
310307

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ src
88
wheelhouse
99
.idea/
1010
ssh2/libssh2.so*
11+
doc/_build

0 commit comments

Comments
 (0)