From c5d2be5bb2ba822686f83aaad645e025ff97aa0d Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Tue, 16 Jul 2019 13:47:47 -0400 Subject: [PATCH] [Travis] Work around Windows not officially supporting python Based on a patch from aiudirog. Merges: #179 Closes: #32 --- .travis.yml | 33 +++++++++++-------------- .travis/before-deploy-windows-wheels.sh | 4 +++ .travis/deploy-win.sh | 26 +++++++++++++++++++ 3 files changed, 45 insertions(+), 18 deletions(-) create mode 100755 .travis/deploy-win.sh diff --git a/.travis.yml b/.travis.yml index 33108a6c..62d45690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,10 +123,9 @@ jobs: all_branches: true - provider: pypi - user: - secure: "jUAMucBq+9xH8x9u0I0LOwrs3Zb++KN7FwIIwz2CyAt/+TyyrJzeGJaV+dTiJ1OqcUIFqQG6jopzpnAe4biL1O68PEwz9BphKetFLpLHiFNm/n67LYno6NFonWmxndIy99pOP6NZu29nzSNeYq/KgEHo/5OkqEGOxk//lh7X/OY=" + user: rharwood password: - secure: "ZqywwnR+G5VeM2sStwfLeutOvqbULHtnStjrdYc8WcC/FBVwmH/W48fTlvxrnswmfKx7Eljv0nN4VcBpoFf1tvz4O2oK/tCRpf0N8SvpT0jBx8bLGUxJ1/3Po6rFgBRWgSb/mzKHPKI6fLlQNcNg8lrd9e1j/zgbVRSwNeMUOR8=" + secure: "hN861mjtLeC8IysypC6Pqzlazq29I+c69XGjbUR53izYQ90cz2F+B2azVTl9Su9NbXzdsGnhWZrjY1jtYMPIZE15xDaC8vs61QijFClqmyuKNRVzCt1w/sj21hyLXnYIrkAo4e3bswPF+hRGNwfb+rVrR/dqUwd1wyjZBBYMcQE=" skip_cleanup: true docs_dir: travis_docs_build/html on: @@ -143,23 +142,21 @@ jobs: - &win_deploy stage: deploy os: windows - script: skip - env: PYTHON="2" PYENV="2.7.16" EXTRA_BUILDEXT="--compiler=mingw32" - before_deploy: + script: # This is egregious hacks around Travis - ./.travis/before-deploy-windows-wheels.sh - deploy: - - provider: pypi - user: - secure: "jUAMucBq+9xH8x9u0I0LOwrs3Zb++KN7FwIIwz2CyAt/+TyyrJzeGJaV+dTiJ1OqcUIFqQG6jopzpnAe4biL1O68PEwz9BphKetFLpLHiFNm/n67LYno6NFonWmxndIy99pOP6NZu29nzSNeYq/KgEHo/5OkqEGOxk//lh7X/OY=" - password: - secure: "ZqywwnR+G5VeM2sStwfLeutOvqbULHtnStjrdYc8WcC/FBVwmH/W48fTlvxrnswmfKx7Eljv0nN4VcBpoFf1tvz4O2oK/tCRpf0N8SvpT0jBx8bLGUxJ1/3Po6rFgBRWgSb/mzKHPKI6fLlQNcNg8lrd9e1j/zgbVRSwNeMUOR8=" - skip_cleanup: true - on: - all_branches: true - distributions: "check" # Hack, see above + - ./.travis/deploy-win.sh + env: + - PYTHON="2" + - PYENV="2.7.16" + - EXTRA_BUILDEXT="--compiler=mingw32" + language: sh # Travis doesn't support python here - <<: *win_deploy - env: PYTHON="3" PYENV="3.6.8" + env: + - PYTHON="3" + - PYENV="3.6.8" - <<: *win_deploy - env: PYTHON="3" PYENV="3.7.3" + env: + - PYTHON="3" + - PYENV="3.7.3" diff --git a/.travis/before-deploy-windows-wheels.sh b/.travis/before-deploy-windows-wheels.sh index ea8c276b..000d62a5 100644 --- a/.travis/before-deploy-windows-wheels.sh +++ b/.travis/before-deploy-windows-wheels.sh @@ -7,6 +7,10 @@ source ./.travis/lib-deploy.sh ./.travis/build.sh +# Sigh, go find paths again +PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}" +export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH" + # build the wheel python -m pip install wheel python setup.py bdist_wheel diff --git a/.travis/deploy-win.sh b/.travis/deploy-win.sh new file mode 100755 index 00000000..b66b56d8 --- /dev/null +++ b/.travis/deploy-win.sh @@ -0,0 +1,26 @@ +#!/bin/bash -e + +# Temporary hack while issue DPL issue persists +# Manually upload wheels via twine for windows +# https://github.com/travis-ci/dpl/issues/1009 + +success="yes" + +# Sigh, go find paths again +PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}" +export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH" + +echo 'Running: python -m pip install twine ...' +python -m pip install twine + +echo 'Running: set +x; python -m twine upload...' +# Please note this cannot be set -x or passwords will leak! +set +x + +python -m twine upload -u $TWINE_USER -p $TWINE_PASSWORD dist/gssapi* > out.log 2>&1 || true + +# and restore... +set -x +egrep -i 'fail|error' out.log && cat out.log && exit 1 + +exit 0