Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83820a0

Browse files
authored
Automatically trigger a test mypyc build on master commits (#5672)
We want to automatically build mypyc-compiled mypy wheels for mypy master commits. To do this, we use a separate github repo that has mypy and mypyc as submodules and which automatically builds wheel images and uploads them as github release artifacts. Currently, for testing purposes, the target repo is https://github.com/msullivan/travis-testing. Obviously this will need to be something else later. The push is done as the `mypy-build-bot` github user, and I configured travis with an API token for that account as the `$WHEELS_PUSH_TOKEN` environment variable.
1 parent 8df6adc commit 83820a0

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ jobs:
3636
env:
3737
- TOXENV=lint
3838
- EXTRA_ARGS=
39+
- name: "trigger a build of wheels"
40+
stage: deploy
41+
python: 3.7
42+
script: if [[ $TRAVIS_BRANCH = "master" && $TRAVIS_PULL_REQUEST = "false" ]]; then ./misc/trigger_wheel_build.sh; fi
3943

4044
install:
4145
- pip install -U pip setuptools

misc/trigger_wheel_build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -eux
2+
3+
# Trigger a build of mypyc compiled mypy wheels by updating the mypy
4+
# submodule in the git repo that drives those builds.
5+
6+
# TODO: This is a testing repo and will need to be retargeted at the
7+
# real location once it exists. $WHEELS_PUSH_TOKEN is stored in travis
8+
# and is an API token for the mypy-build-bot account.
9+
git clone --recurse-submodules https://${WHEELS_PUSH_TOKEN}@github.com/msullivan/travis-testing.git build
10+
11+
git config --global user.email "nobody"
12+
git config --global user.name "mypy wheels autopush"
13+
14+
COMMIT=$(git rev-parse HEAD)
15+
cd build/mypy
16+
git fetch
17+
git checkout $COMMIT
18+
pip install -r test-requirements.txt
19+
V=$(python3 -m mypy --version)
20+
V=$(echo "$V" | cut -d" " -f2)
21+
cd ..
22+
git commit -am "Build wheels for mypy $V"
23+
git tag v$V
24+
git push --tags origin master

0 commit comments

Comments
 (0)