Skip to content

Commit c5d2be5

Browse files
[Travis] Work around Windows not officially supporting python
Based on a patch from aiudirog. Merges: #179 Closes: #32
1 parent 826c02d commit c5d2be5

File tree

3 files changed

+45
-18
lines changed

3 files changed

+45
-18
lines changed

.travis.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ jobs:
123123
all_branches: true
124124

125125
- provider: pypi
126-
user:
127-
secure: "jUAMucBq+9xH8x9u0I0LOwrs3Zb++KN7FwIIwz2CyAt/+TyyrJzeGJaV+dTiJ1OqcUIFqQG6jopzpnAe4biL1O68PEwz9BphKetFLpLHiFNm/n67LYno6NFonWmxndIy99pOP6NZu29nzSNeYq/KgEHo/5OkqEGOxk//lh7X/OY="
126+
user: rharwood
128127
password:
129-
secure: "ZqywwnR+G5VeM2sStwfLeutOvqbULHtnStjrdYc8WcC/FBVwmH/W48fTlvxrnswmfKx7Eljv0nN4VcBpoFf1tvz4O2oK/tCRpf0N8SvpT0jBx8bLGUxJ1/3Po6rFgBRWgSb/mzKHPKI6fLlQNcNg8lrd9e1j/zgbVRSwNeMUOR8="
128+
secure: "hN861mjtLeC8IysypC6Pqzlazq29I+c69XGjbUR53izYQ90cz2F+B2azVTl9Su9NbXzdsGnhWZrjY1jtYMPIZE15xDaC8vs61QijFClqmyuKNRVzCt1w/sj21hyLXnYIrkAo4e3bswPF+hRGNwfb+rVrR/dqUwd1wyjZBBYMcQE="
130129
skip_cleanup: true
131130
docs_dir: travis_docs_build/html
132131
on:
@@ -143,23 +142,21 @@ jobs:
143142
- &win_deploy
144143
stage: deploy
145144
os: windows
146-
script: skip
147-
env: PYTHON="2" PYENV="2.7.16" EXTRA_BUILDEXT="--compiler=mingw32"
148-
before_deploy:
145+
script: # This is egregious hacks around Travis
149146
- ./.travis/before-deploy-windows-wheels.sh
150-
deploy:
151-
- provider: pypi
152-
user:
153-
secure: "jUAMucBq+9xH8x9u0I0LOwrs3Zb++KN7FwIIwz2CyAt/+TyyrJzeGJaV+dTiJ1OqcUIFqQG6jopzpnAe4biL1O68PEwz9BphKetFLpLHiFNm/n67LYno6NFonWmxndIy99pOP6NZu29nzSNeYq/KgEHo/5OkqEGOxk//lh7X/OY="
154-
password:
155-
secure: "ZqywwnR+G5VeM2sStwfLeutOvqbULHtnStjrdYc8WcC/FBVwmH/W48fTlvxrnswmfKx7Eljv0nN4VcBpoFf1tvz4O2oK/tCRpf0N8SvpT0jBx8bLGUxJ1/3Po6rFgBRWgSb/mzKHPKI6fLlQNcNg8lrd9e1j/zgbVRSwNeMUOR8="
156-
skip_cleanup: true
157-
on:
158-
all_branches: true
159-
distributions: "check" # Hack, see above
147+
- ./.travis/deploy-win.sh
148+
env:
149+
- PYTHON="2"
150+
- PYENV="2.7.16"
151+
- EXTRA_BUILDEXT="--compiler=mingw32"
152+
language: sh # Travis doesn't support python here
160153

161154
- <<: *win_deploy
162-
env: PYTHON="3" PYENV="3.6.8"
155+
env:
156+
- PYTHON="3"
157+
- PYENV="3.6.8"
163158

164159
- <<: *win_deploy
165-
env: PYTHON="3" PYENV="3.7.3"
160+
env:
161+
- PYTHON="3"
162+
- PYENV="3.7.3"

.travis/before-deploy-windows-wheels.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ source ./.travis/lib-deploy.sh
77

88
./.travis/build.sh
99

10+
# Sigh, go find paths again
11+
PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}"
12+
export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH"
13+
1014
# build the wheel
1115
python -m pip install wheel
1216
python setup.py bdist_wheel

.travis/deploy-win.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash -e
2+
3+
# Temporary hack while issue DPL issue persists
4+
# Manually upload wheels via twine for windows
5+
# https://github.com/travis-ci/dpl/issues/1009
6+
7+
success="yes"
8+
9+
# Sigh, go find paths again
10+
PYPATH="/c/Python${PYENV:0:1}${PYENV:2:1}"
11+
export PATH="$PYPATH:$PYPATH/Scripts:/c/Program Files/MIT/Kerberos/bin:$PATH"
12+
13+
echo 'Running: python -m pip install twine ...'
14+
python -m pip install twine
15+
16+
echo 'Running: set +x; python -m twine upload...'
17+
# Please note this cannot be set -x or passwords will leak!
18+
set +x
19+
20+
python -m twine upload -u $TWINE_USER -p $TWINE_PASSWORD dist/gssapi* > out.log 2>&1 || true
21+
22+
# and restore...
23+
set -x
24+
egrep -i 'fail|error' out.log && cat out.log && exit 1
25+
26+
exit 0

0 commit comments

Comments
 (0)