diff --git a/.appveyor.yml b/.appveyor.yml index 1a72cefa..e31995b9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,7 +5,7 @@ environment: # See: http://stackoverflow.com/a/13751649/163740 CMD_IN_ENV: "cmd /E:ON /V:ON /C %APPVEYOR_BUILD_FOLDER%\\ci\\appveyor\\run_with_env.cmd" PYTHONUNBUFFERED: 1 - OPENSSL_VER: 1.0.2l + OPENSSL_VER: 1.0.2o PYPI_USER: secure: 2m0jy6JD/R9RExIosOT6YA== PYPI_PASS: @@ -81,18 +81,17 @@ install: - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - # - "pip install --disable-pip-version-check --user --upgrade pip" + - "python -m pip install -U pip" + - "python -m pip install -U setuptools" - git submodule update --init --recursive - - appveyor DownloadFile http://zlib.net/zlib1211.zip - - 7z x zlib1211.zip - - appveyor DownloadFile https://indy.fulgan.com/SSL/openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip - - 7z x openssl-%OPENSSL_VER%-%ARCH%-win%PYTHON_ARCH%.zip + - 7z x ci\appveyor\zlib1211.zip + - 7z x ci\appveyor\openssl-%OPENSSL_VER%-win%PYTHON_ARCH%.zip - cp ssleay32.dll pssh\native\ - cp libeay32.dll pssh\native\ - ps: ls pssh\native - "%CMD_IN_ENV% pip install -r requirements.txt" - - "%CMD_IN_ENV% pip install -U wheel setuptools twine" + - "%CMD_IN_ENV% pip install -U wheel twine" build_script: - "%CMD_IN_ENV% ci\\appveyor\\build_zlib.bat" diff --git a/.travis.yml b/.travis.yml index 42c51edb..07584cdb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ language: python -cache: pip +cache: + - pip + - directories: + - "$HOME/.pyenv" sudo: required notifications: email: false @@ -41,54 +44,29 @@ after_success: jobs: include: - - stage: build packages + - &osx-wheels + stage: build packages os: osx - osx_image: xcode6.4 + osx_image: xcode8 + env: + - PYENV: 3.6.4 before_install: - brew update - install: - - brew upgrade openssl + - brew outdated openssl || brew upgrade openssl + - brew link --overwrite python@2 || brew install python@2 || brew link --overwrite python@2 + - which python2 + - python2 -c "from __future__ import print_function; import ssl; from platform import python_version; print(ssl.OPENSSL_VERSION); print(python_version())" + - sudo -H pip2 install twine + - which twine - sudo ci/install-ssh2.sh - - ls -lh - - python --version - - wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py - - sudo python get-pip.py - - sudo -H pip install -U pip - - sudo -H pip install -U delocate twine wheel pip setuptools - cp /usr/local/lib/libssh2* . - - pip install --user -r requirements.txt - - pip wheel --no-deps . - script: - - delocate-listdeps --all *.whl - - delocate-wheel -v *.whl - - delocate-listdeps --all *.whl - - ls -l *.whl - - rm -f *.dylib - - pip install --user -v *.whl - - pwd; mkdir temp; cd temp; pwd - - python -c "import pssh.clients" - - cd ..; pwd - after_success: - - if [[ ! -z "$TRAVIS_TAG" ]]; then - twine upload -u $PYPI_U -p $PYPI_P *.whl; - fi - language: generic - python: skip - - - stage: build packages - os: osx - osx_image: xcode8.3 - before_install: - - brew update + - mkdir -p wheels install: - - brew upgrade openssl - - sudo ci/install-ssh2.sh - - sudo -H pip2 install -U delocate twine wheel pip setuptools - - cp /usr/local/lib/libssh2* . + - sudo -H pip2 install -U delocate wheel pip setuptools - ls -lh - pip2 install --user -r requirements.txt - - pip2 wheel --no-deps . script: + - pip2 wheel --no-deps . - delocate-listdeps --all *.whl - delocate-wheel -v *.whl - delocate-listdeps --all *.whl @@ -98,72 +76,55 @@ jobs: - pwd; mkdir temp; cd temp; pwd - python -c "import pssh.clients" - cd ..; pwd + - mv -f *.whl wheels/ + - ./ci/travis/pyenv-wheel.sh after_success: - if [[ ! -z "$TRAVIS_TAG" ]]; then - twine upload -u $PYPI_U -p $PYPI_P *.whl; + twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheels/*.whl; fi language: generic python: skip - - stage: build packages - os: osx + - <<: *osx-wheels + osx_image: xcode6.4 + + - <<: *osx-wheels + osx_image: xcode6.4 + env: + - PYENV: 3.7.0 + install: skip + script: + - ./ci/travis/pyenv-wheel.sh + + - <<: *osx-wheels + osx_image: xcode8.3 + + - <<: *osx-wheels + osx_image: xcode9.3 + + - <<: *osx-wheels osx_image: xcode8 - before_install: - - brew update - install: - - brew upgrade openssl - - sudo ci/install-ssh2.sh - - sudo rm -f libssh2.1.dylib - - sudo pip2 install -U delocate twine wheel pip setuptools - - cp /usr/local/lib/libssh2* . - - pip2 install --user -r requirements.txt - - pip2 wheel --no-deps . + env: + - PYENV: 3.7.0 + install: skip script: - - delocate-listdeps --all *.whl - - delocate-wheel -v *.whl - - delocate-listdeps --all *.whl - - ls -l *.whl - - rm -f *.dylib - - pip2 install --user -v *.whl - - pwd; mkdir temp; cd temp; pwd - - python -c "import pssh.clients" - - cd ..; pwd - after_success: - - if [[ ! -z "$TRAVIS_TAG" ]]; then - twine upload -u $PYPI_U -p $PYPI_P *.whl; - fi - language: generic - python: skip + - ./ci/travis/pyenv-wheel.sh - - stage: build packages - os: osx + - <<: *osx-wheels + osx_image: xcode8.3 + env: + - PYENV: 3.7.0 + install: skip + script: + - ./ci/travis/pyenv-wheel.sh + + - <<: *osx-wheels osx_image: xcode9.3 - before_install: - - brew update - install: - - brew upgrade openssl - - sudo ci/install-ssh2.sh - - sudo -H pip2 install -U delocate twine wheel pip setuptools - - cp /usr/local/lib/libssh2* . - - ls -lh - - pip2 install --user -r requirements.txt - - pip2 wheel --no-deps . + env: + - PYENV: 3.7.0 + install: skip script: - - delocate-listdeps --all *.whl - - delocate-wheel -v *.whl - - delocate-listdeps --all *.whl - - ls -l *.whl - - rm -f *.dylib - - pip2 install --user -v *.whl - - pwd; mkdir temp; cd temp; pwd - - python -c "import pssh.clients" - - cd ..; pwd - after_success: - - if [[ ! -z "$TRAVIS_TAG" ]]; then - twine upload -u $PYPI_U -p $PYPI_P *.whl; - fi - language: generic - python: skip + - ./ci/travis/pyenv-wheel.sh - os: linux stage: build packages @@ -190,6 +151,7 @@ jobs: - stage: build packages env: - WHEELS=1 + - OPENSSL=openssl-1.0.2o os: linux python: 3.6 before_install: skip @@ -200,7 +162,7 @@ jobs: ./ci/travis/build-manylinux.sh; after_success: - if [[ ! -z "$TRAVIS_TAG" ]]; then - twine upload -u $PYPI_U -p $PYPI_P wheelhouse/*.whl; + twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl; fi deploy: - provider: pypi diff --git a/ci/appveyor/openssl-1.0.2o-win32.zip b/ci/appveyor/openssl-1.0.2o-win32.zip new file mode 100644 index 00000000..250da95c Binary files /dev/null and b/ci/appveyor/openssl-1.0.2o-win32.zip differ diff --git a/ci/appveyor/openssl-1.0.2o-win64.zip b/ci/appveyor/openssl-1.0.2o-win64.zip new file mode 100644 index 00000000..d9f15ac7 Binary files /dev/null and b/ci/appveyor/openssl-1.0.2o-win64.zip differ diff --git a/ci/appveyor/zlib1211.zip b/ci/appveyor/zlib1211.zip new file mode 100644 index 00000000..56fc1867 Binary files /dev/null and b/ci/appveyor/zlib1211.zip differ diff --git a/ci/docker/manylinux/Dockerfile b/ci/docker/manylinux/Dockerfile index e51da10c..b54b5d5d 100644 --- a/ci/docker/manylinux/Dockerfile +++ b/ci/docker/manylinux/Dockerfile @@ -1,7 +1,7 @@ FROM quay.io/pypa/manylinux1_x86_64 ENV CMAKE cmake-2.8.11.1-5.4.x86_64 -ENV OPENSSL openssl-1.0.2l +ENV OPENSSL openssl-1.0.2o ENV LIBSSH2_VER agent_fwd RUN yum install zlib-devel -y diff --git a/ci/travis/build-wheels.sh b/ci/travis/build-wheels.sh index e3abcc45..195cee7c 100755 --- a/ci/travis/build-wheels.sh +++ b/ci/travis/build-wheels.sh @@ -1,8 +1,7 @@ #!/bin/bash -xe # Compile wheels -for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython | grep -v cp37`; do - "${PYBIN}/pip" install gevent==1.1 +for PYBIN in `ls -1d /opt/python/cp*/bin`; do "${PYBIN}/pip" install -r /io/requirements.txt "${PYBIN}/pip" wheel --no-deps /io/ -w wheelhouse/ done @@ -13,7 +12,7 @@ for whl in wheelhouse/*.whl; do done # Install packages and test -for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython | grep -v cp37`; do +for PYBIN in `ls -1d /opt/python/cp*/bin`; do "${PYBIN}/pip" install parallel-ssh --no-index -f /io/wheelhouse (cd "$HOME"; "${PYBIN}/python" -c 'import pssh.native._ssh2') done diff --git a/ci/travis/pyenv-wheel.sh b/ci/travis/pyenv-wheel.sh new file mode 100755 index 00000000..b7cc432a --- /dev/null +++ b/ci/travis/pyenv-wheel.sh @@ -0,0 +1,45 @@ +#!/bin/bash -xe + +brew install pyenv || brew outdated pyenv || brew upgrade pyenv + +export PYENV_VERSION=${PYENV:-3.6.4} +if [[ ! -d "$HOME/.pyenv/versions/$PYENV_VERSION" ]]; then + pyenv install $PYENV_VERSION +fi +pyenv global $PYENV_VERSION +pyenv versions + +set +x +eval "$(pyenv init -)" +set -x + +which python +python -m pip install -U virtualenv +python -m virtualenv -p "$(which python)" venv + +set +x +source venv/bin/activate +set -x + +python -V +python -m pip install -U setuptools pip +pip install -U delocate wheel +pip install -r requirements.txt +pip wheel --no-deps . +cp /usr/local/lib/libssh2* . +delocate-listdeps --all *.whl +delocate-wheel -v *.whl +delocate-listdeps --all *.whl + +ls -l *.whl +rm -f *.dylib +pip install -v *.whl +pwd; mkdir -p temp; cd temp; pwd +python -c "import pssh.clients" && echo "Import successfull" +cd ..; pwd +set +x +deactivate +set -x + +mv -f *.whl wheels/ +ls -lh wheels/ diff --git a/pssh/clients/native/single.py b/pssh/clients/native/single.py index e656ad61..63d1f89d 100644 --- a/pssh/clients/native/single.py +++ b/pssh/clients/native/single.py @@ -398,6 +398,8 @@ def run_command(self, command, sudo=False, user=None, :param encoding: Encoding to use for output. Must be valid `Python codec `_ :type encoding: str + + :rtype: (channel, host, stdout, stderr, stdin) tuple. """ # Fast path for no command substitution needed if not sudo and not user and not shell: diff --git a/setup.py b/setup.py index 2b7c20b5..57bcdb13 100644 --- a/setup.py +++ b/setup.py @@ -98,20 +98,27 @@ ), install_requires=['paramiko', gevent_req, 'ssh2-python>=0.15.0'], classifiers=[ - 'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)', - 'Intended Audience :: Developers', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Operating System :: POSIX :: Linux', - 'Operating System :: POSIX :: BSD', - 'Operating System :: Microsoft :: Windows', - ], + 'Development Status :: 5 - Production/Stable', + 'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)', + 'Intended Audience :: Developers', + 'Operating System :: OS Independent', + 'Programming Language :: C', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Topic :: System :: Networking', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Operating System :: POSIX :: Linux', + 'Operating System :: POSIX :: BSD', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: MacOS :: MacOS X', + ], ext_modules=extensions, package_data=package_data, )