From d039bde447003f1d3247acf187076c6baf5fd7e7 Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Tue, 5 Jan 2016 22:32:52 -0800 Subject: [PATCH] Removing use of wheelhouse and relying on Travis caching. --- .gitignore | 3 -- .travis.yml | 12 +++---- CONTRIBUTING.rst | 22 +++++------- scripts/custom_pip_install.sh | 21 ----------- scripts/merge.sh | 2 +- scripts/update_wheels_project.sh | 61 -------------------------------- tox.ini | 2 -- 7 files changed, 16 insertions(+), 107 deletions(-) delete mode 100755 scripts/custom_pip_install.sh delete mode 100755 scripts/update_wheels_project.sh diff --git a/.gitignore b/.gitignore index 3f9406901fd2..251d29a15f5a 100644 --- a/.gitignore +++ b/.gitignore @@ -50,9 +50,6 @@ system_tests/local_test_setup # Make sure a generated file isn't accidentally committed. pylintrc_reduced -# Travis build directories. -gcloud-python-wheels/ - # Directories used for creating generated PB2 files generated_python/ cloud-bigtable-client/ diff --git a/.travis.yml b/.travis.yml index e022e455c039..1d560ffb2848 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,9 @@ language: python sudo: false -before_install: - - git clone https://github.com/GoogleCloudPlatform/gcloud-python-wheels - gcloud-python-wheels - - export WHEELHOUSE="$(pwd)/gcloud-python-wheels/wheelhouse/" - install: - - scripts/custom_pip_install.sh tox + - pip install --upgrade pip + - pip install --upgrade tox script: - tox -e py26 @@ -32,3 +28,7 @@ deploy: # until this is fixed: https://github.com/travis-ci/travis-ci/issues/1675 all_branches: true distributions: "sdist bdist_wheel" + +cache: + directories: + - ${HOME}/.cache/pip diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 67b53526d0bd..fc79671ff5dc 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -283,22 +283,18 @@ Python dependencies are specified in the ``tox.ini`` configuration. They are executed in the Travis build via ``tox -e {ENV}`` where ``{ENV}`` is the environment being tested. -By enumerating all Python dependencies in the ``tox`` configuration, -we can use our custom ``gcloud-python-wheels`` -`wheelhouse `__ -to speed up builds. This project builds and stores pre-built Python -`wheels `__ for every Python dependency our library -and tests have. - If new ``tox`` environments are added to be run in a Travis build, they -should either be: +should be listed in ``[tox].envlist`` as a default environment. + +We speed up builds by using the Travis `caching feature`_. -- listed in ``[tox].envlist`` as a default environment +.. _caching feature: https://docs.travis-ci.com/user/caching/#pip-cache -- added to the list in the - `Travis environment variable `__ - ``EXTRA_TOX_ENVS``. This value is unencrypted in ``gcloud-python-wheels`` - to make ongoing maintenance easier. +We intentionally **do not** cache the ``.tox/`` directory. Instead, we +allow the ``tox`` environments to be re-built for every build. This +way, we'll always get the latest versions of our dependencies and any +caching or wheel optimization to be done will be handled automatically +by ``pip``. Supported Python Versions ------------------------- diff --git a/scripts/custom_pip_install.sh b/scripts/custom_pip_install.sh deleted file mode 100755 index 0e662b60ae48..000000000000 --- a/scripts/custom_pip_install.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# Copyright 2014 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if [[ -d ${WHEELHOUSE} ]]; then - pip install --no-index --find-links=${WHEELHOUSE} "$@" -fi -# Update if the locally cached wheels are out-of-date. -pip install --upgrade "$@" diff --git a/scripts/merge.sh b/scripts/merge.sh index 2c2111a2e0f4..bb7ec8a7918a 100755 --- a/scripts/merge.sh +++ b/scripts/merge.sh @@ -21,8 +21,8 @@ set -ev ############################################## if [[ "${TRAVIS_BRANCH}" == "master" ]] && \ [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then + echo "Building new docs on a merged commit." scripts/update_docs.sh - scripts/update_wheels_project.sh elif [[ -n "${TRAVIS_TAG}" ]]; then echo "Building new docs on a tag." scripts/update_docs.sh diff --git a/scripts/update_wheels_project.sh b/scripts/update_wheels_project.sh deleted file mode 100755 index 4068fc49ad3a..000000000000 --- a/scripts/update_wheels_project.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# Copyright 2014 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ev - -######################################### -# Settings for specific wheels project. # -######################################### -WHEELS_PROJECT_NAME="gcloud-python-wheels" -# "gcloud-python-wheels" is already used by .travis.yml -FRESH_REPO_DIR="gcloud-python-wheels-fresh" - -################################### -# Checkout the wheels repository. # -################################### -git config --global user.email "travis@travis-ci.org" -git config --global user.name "travis-ci" -git clone --quiet --branch=master \ - "https://${GH_OAUTH_TOKEN}@github.com//${GH_OWNER}/${WHEELS_PROJECT_NAME}" \ - ${FRESH_REPO_DIR} -# NOTE: Assumes ${GH_OAUTH_TOKEN} and ${GH_OWNER} are set in Travis build -# settings for project. This also assumes the wheels project is owned by -# ${GH_OWNER} and that the token can be used to make commits. - -################################################# -# Add the current commit hash to a static file. # -################################################# -echo "${TRAVIS_COMMIT}" > ${FRESH_REPO_DIR}/LATEST_COMMIT - -############################################## -# Display git status and push LATEST_COMMIT. # -############################################## -cd ${FRESH_REPO_DIR} - -# allow "git add" to fail if there aren't new files. -# this can happen if we re-run builds on travis. -set +e -git add LATEST_COMMIT -set -e -git status -# H/T: https://github.com/dhermes -if [[ -n "$(git status --porcelain)" ]]; then - git commit -m "Main project gcloud-python has been updated." - git status - git push origin master -else - echo "Nothing to commit. Exiting without pushing changes." -fi diff --git a/tox.ini b/tox.ini index 4de28f423371..b780112cb6e8 100644 --- a/tox.ini +++ b/tox.ini @@ -3,8 +3,6 @@ envlist = py26,py27,py33,py34,cover,docs,lint [testenv] -install_command = - {toxinidir}/scripts/custom_pip_install.sh {opts} {packages} commands = nosetests deps =