diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..bad5157a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,145 @@ +version: 2.1 + +orbs: + python: circleci/python@0.3.2 + +jobs: + python_test: + parameters: + python_ver: + type: string + default: "3.6" + docker: + - image: circleci/python:<< parameters.python_ver >> + steps: + - checkout + - python/load-cache: + dependency-file: requirements_dev.txt + key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >> + - run: + name: Deps + command: | + sudo apt-get install cmake openssh-server + pip install -r requirements_dev.txt + - python/save-cache: + dependency-file: requirements_dev.txt + key: depsv3-{{ .Branch }}.{{ arch }}-PY<< parameters.python_ver >> + - run: + command: | + python setup.py build_ext --inplace + eval "$(ssh-agent -s)" + name: Build + - run: + command: | + ls -lhtr ssh2/ + pwd + pytest tests + flake8 ssh2 + python setup.py sdist + cd dist; pip install *; python -c 'from ssh2.session import Session; Session()'; cd .. + cd doc + make html + cd .. + name: Test + + osx: + parameters: + xcode_ver: + type: string + default: "11.6.0" + macos: + xcode: << parameters.xcode_ver >> + environment: + HOMEBREW_NO_AUTO_UPDATE: 1 + SYSTEM_LIBSSH2: 1 + steps: + - checkout + - run: + name: deps + command: | + brew install cmake git-lfs python libssh2 + pip3 install twine + which twine + - run: + name: Build Wheel + command: | + ./ci/osx-wheel.sh + - store_artifacts: + path: wheels + - run: + name: Upload Wheel + command: | + twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheels/* + + manylinux: + machine: + image: ubuntu-1604:201903-01 + 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 python-pip + pip install -U pip + pip 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 + echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin; + fi + ./ci/travis/build-manylinux.sh + - run: + name: sdist + command: python setup.py sdist + - run: + name: Upload Wheels + command: | + twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/* + +workflows: + version: 2.1 + main: + jobs: + - python_test: + matrix: + parameters: + python_ver: + - "3.6" + - "3.7" + - "3.8" + filters: + tags: + ignore: /.*/ + - manylinux: + context: Docker + filters: + tags: + only: /.*/ + branches: + ignore: /.*/ + - osx: + matrix: + parameters: + xcode_ver: + - "11.6.0" + - "11.1.0" + filters: + tags: + only: /.*/ + branches: + ignore: /.*/ diff --git a/.travis.yml b/.travis.yml index 1ba83d62..ac5b4174 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,6 @@ notifications: email: false python: - 2.7 - - 3.6 - - 3.7 - - 3.8 install: - pip install flake8 jinja2 sphinx sphinx_rtd_theme - python setup.py build_ext --inplace @@ -44,46 +41,44 @@ jobs: include: - stage: test - if: type = push OR \ - (type = pull_request AND fork = true) - - &osx-wheels - stage: build packages - if: tag IS present - os: osx - osx_image: xcode11.6 - env: - - SYSTEM_LIBSSH2: 1 - before_install: - - brew install libssh2 - - pip3 install twine - - which twine - install: skip - script: - - ./ci/osx-wheel.sh - after_success: - - if [[ ! -z "$TRAVIS_TAG" ]]; then - twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheels/*.whl; - fi - language: generic - python: skip + # - &osx-wheels + # stage: build packages + # if: tag IS present + # os: osx + # osx_image: xcode11.6 + # env: + # - SYSTEM_LIBSSH2: 1 + # before_install: + # - brew install libssh2 + # - pip3 install twine + # - which twine + # install: skip + # script: + # - ./ci/osx-wheel.sh + # after_success: + # - if [[ ! -z "$TRAVIS_TAG" ]]; then + # twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheels/*.whl; + # fi + # language: generic + # python: skip - - <<: *osx-wheels - osx_image: xcode11.3 + # - <<: *osx-wheels + # osx_image: xcode11.3 - - stage: build packages - if: tag IS present - os: linux - python: 3.6 - env: - - WHEELS=1 - install: - - pip install twine - script: - - python setup.py sdist - - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi - - ./ci/travis/build-manylinux.sh - after_success: - - if [[ ! -z "$TRAVIS_TAG" ]]; then - twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl dist/*; - fi + # - stage: build packages + # if: tag IS present + # os: linux + # python: 3.6 + # env: + # - WHEELS=1 + # install: + # - pip install twine + # script: + # - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; fi + # - ./ci/travis/build-manylinux.sh + # - python setup.py sdist + # after_success: + # - if [[ ! -z "$TRAVIS_TAG" ]]; then + # twine upload --skip-existing -u $PYPI_U -p $PYPI_P wheelhouse/*.whl dist/*; + # fi diff --git a/ci/travis/build-manylinux.sh b/ci/travis/build-manylinux.sh index 36d839a4..9ec17450 100755 --- a/ci/travis/build-manylinux.sh +++ b/ci/travis/build-manylinux.sh @@ -2,7 +2,7 @@ docker_tag="parallelssh/ssh2-manylinux" -rm -rf build dist ssh2/libssh2.* +rm -rf build ssh2/libssh2.* python ci/appveyor/fix_version.py . docker pull $docker_tag || echo