Skip to content

Commit

Permalink
[Travis] Work around Windows not officially supporting python
Browse files Browse the repository at this point in the history
Based on a patch from aiudirog.

Merges: #179
Closes: #32
  • Loading branch information
frozencemetery committed Aug 9, 2019
1 parent 826c02d commit c5d2be5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
33 changes: 15 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
4 changes: 4 additions & 0 deletions .travis/before-deploy-windows-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions .travis/deploy-win.sh
Original file line number Diff line number Diff line change
@@ -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

1 comment on commit c5d2be5

@aiudirog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I like the solution of the repo env variables paired with temporarily disabling command echoing. Hopefully the deployment bugs will be ironed out soon so this can be simplified.

Please sign in to comment.