Skip to content

Commit ca6bff4

Browse files
committed
Merge pull request #301 from dhermes/speed-up-build-stage-one
Introducing custom pip install in tox to be used with cached wheels.
2 parents 7d9bfb1 + 5c346cf commit ca6bff4

File tree

4 files changed

+46
-14
lines changed

4 files changed

+46
-14
lines changed

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
language: python
2-
# command to install dependencies
2+
33
install:
4-
- pip install tox
5-
- pip install coveralls
6-
# run tests
4+
- scripts/custom_pip_install.sh tox
5+
76
script:
87
- tox -e py26
98
- tox -e py27
109
- tox -e lint
1110
- tox -e regression
12-
after_success:
13-
- tox -e cover
14-
- coveralls
1511
- scripts/update_docs.sh
12+
after_success:
13+
- tox -e coveralls

scripts/custom_pip_install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
# Temporarily perform default pip install before initial
3+
# wheelhouse is built.
4+
pip install "$@"

scripts/update_docs.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
#!/bin/bash
22

3+
# Copyright 2014 Google Inc. All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
317
set -ev
418

5-
# If merging to master and not a pull request, update docs.
6-
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
7-
# Generate new set of json files in docs/json/master.
19+
if [[ "${TRAVIS_BRANCH}" == "master" ]] && \
20+
[[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then
21+
# Build new docset in docs/_build from master.
822
tox -e docs
9-
git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} ghpages
23+
git submodule add -b gh-pages \
24+
"https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME}" \
25+
ghpages
1026
cp -R docs/_build/html/* ghpages/
1127
cd ghpages
1228
git add .
1329
# Commit to gh-pages branch to apply changes.
1430
git config user.name "selfiebot"
1531
git commit -m "Update docs after merge to master."
16-
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages
32+
git push \
33+
"https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME}" \
34+
HEAD:gh-pages
35+
else
36+
echo "Not in master on a non-pull request. Doing nothing."
1737
fi

tox.ini

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ deps =
1111
protobuf==2.6.0
1212

1313
[testenv]
14+
install_command =
15+
{toxinidir}/scripts/custom_pip_install.sh {opts} {packages}
1416
commands =
1517
nosetests
1618
deps =
@@ -21,14 +23,22 @@ deps =
2123
basepython =
2224
python2.7
2325
commands =
24-
nosetests --with-xunit --with-xcoverage --cover-package=gcloud \
25-
--nocapture --cover-erase --cover-tests --cover-branches
26+
nosetests --with-xunit --with-xcoverage --cover-package=gcloud --nocapture --cover-erase --cover-tests --cover-branches
2627
deps =
2728
nose
2829
unittest2
2930
coverage
3031
nosexcover
3132

33+
[testenv:coveralls]
34+
basepython = {[testenv:cover]basepython}
35+
commands =
36+
{[testenv:cover]commands}
37+
coveralls
38+
deps =
39+
{[testenv:cover]deps}
40+
coveralls
41+
3242
[testenv:docs]
3343
basepython =
3444
python2.7

0 commit comments

Comments
 (0)