Repository: aurora Updated Branches: refs/heads/master 7b43b99a6 -> c9a71722c
Modernize the pex venv script. This converts from grabbing the old Twitter python pex to grabbing modern pex to match the version specified in 3rdparty to help keep the pex venv up to date with the codebase dependencies. Testing Done: Locally ran this 2x and observed both the proper version (1.1.0) and proper use of the cached venv in the second run: `git clean -fdx build-support && ./build-support/pex --version` Reviewed at https://reviews.apache.org/r/40220/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/c9a71722 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/c9a71722 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/c9a71722 Branch: refs/heads/master Commit: c9a71722c2be40c570cb7a1a7c3cc4b3f1a56e6f Parents: 7b43b99 Author: John Sirois <[email protected]> Authored: Thu Nov 19 10:33:19 2015 -0600 Committer: Joshua Cohen <[email protected]> Committed: Thu Nov 19 10:33:19 2015 -0600 ---------------------------------------------------------------------- build-support/pex | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/c9a71722/build-support/pex ---------------------------------------------------------------------- diff --git a/build-support/pex b/build-support/pex index 54e31f1..3c9ad84 100755 --- a/build-support/pex +++ b/build-support/pex @@ -15,8 +15,6 @@ # Wrapper script for self-bootstrapping pex. set -e -TWITTER_COMMON_PYTHON_VERSION=0.5.9 - if which python2.7 >/dev/null; then PY=`which python2.7` elif which python2.6 >/dev/null; then @@ -27,16 +25,17 @@ else fi HERE=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd) +PEX_REQ=$(grep pex $HERE/../3rdparty/python/requirements.txt) if ! [ -f "$HERE/pex.venv/BOOTSTRAPPED" ] || \ - [ $(< "$HERE/pex.venv/BOOTSTRAPPED") != $TWITTER_COMMON_PYTHON_VERSION ]; then + [ $(< "$HERE/pex.venv/BOOTSTRAPPED") != "$PEX_REQ" ]; then - echo Bootstrapping twitter.common.python @ $TWITTER_COMMON_PYTHON_VERSION + echo Bootstrapping $PEX_REQ rm -fr "$HERE/pex.venv" "$HERE/virtualenv" "$HERE/pex.venv" source "$HERE/pex.venv/bin/activate" - python -m pip install "twitter.common.python==$TWITTER_COMMON_PYTHON_VERSION" - echo $TWITTER_COMMON_PYTHON_VERSION > "$HERE"/pex.venv/BOOTSTRAPPED + python -m pip install $PEX_REQ + echo $PEX_REQ > "$HERE"/pex.venv/BOOTSTRAPPED fi source "$HERE/pex.venv/bin/activate" exec pex "$@"
