From d968179e54c8797bef3a99131307554d5eb16db1 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Tue, 8 Aug 2017 15:35:03 -0700 Subject: [PATCH] py3: Stop running on Python 2 in Travis. This clears the way to dropping logic in lots of places for supporting Python 2. --- .travis.yml | 11 ++--------- tools/provision | 11 +---------- tools/travis/activate-venv | 9 +-------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5438da9040..7d9348d74a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,9 +43,8 @@ env: global: - BOTO_CONFIG=/tmp/nowhere language: python -# We run all of our test suites for both Python 2.7 and 3.4, with the -# exception of static analysis, which is just run once (and checks -# against both Python versions). +# Our test suites generally run on Python 3.4, the version in +# Ubuntu 14.04 trusty, which is the oldest OS release we support. matrix: include: # Travis will actually run the jobs in the order they're listed here; @@ -60,12 +59,6 @@ matrix: env: TEST_SUITE=backend - python: "3.4" env: TEST_SUITE=production - - python: "2.7" - env: TEST_SUITE=frontend - - python: "2.7" - env: TEST_SUITE=backend - - python: "2.7" - env: TEST_SUITE=production sudo: required services: - docker diff --git a/tools/provision b/tools/provision index e5fdb16538..e3ed8fd1a7 100755 --- a/tools/provision +++ b/tools/provision @@ -19,19 +19,10 @@ LOG_PATH="../var/log/provision.log" echo "PROVISIONING STARTING." >> $LOG_PATH -PROVISION_PATH="./lib/provision.py" -if [ -n "$TRAVIS" ]; then - # In CI, we let PATH provide the Python version. - PROVISION_CMD=("$PROVISION_PATH") -else - # In dev, we force Python 3. - PROVISION_CMD=(python3 "$PROVISION_PATH") -fi - # PYTHONUNBUFFERED is important to ensure that tracebacks don't get # lost far above where they should be in the output. export PYTHONUNBUFFERED=1 -"${PROVISION_CMD[@]}" "$@" 2>&1 | tee -a "$LOG_PATH" +python3 ./lib/provision.py "$@" 2>&1 | tee -a "$LOG_PATH" failed=${PIPESTATUS[0]} if [ $failed = 1 ]; then diff --git a/tools/travis/activate-venv b/tools/travis/activate-venv index 2876603c24..4fb4e8fe38 100644 --- a/tools/travis/activate-venv +++ b/tools/travis/activate-venv @@ -1,11 +1,4 @@ #!/bin/bash -py_version="$(python -c 'import sys; print(sys.version_info[0])')" - -if [ "$py_version" == 2 ]; then - source /srv/zulip-venv/bin/activate -else - source /srv/zulip-py3-venv/bin/activate -fi - +source /srv/zulip-py3-venv/bin/activate echo "Using $VIRTUAL_ENV"