py3: Stop running on Python 2 in Travis.

This clears the way to dropping logic in lots of places
for supporting Python 2.
This commit is contained in:
Greg Price 2017-08-08 15:35:03 -07:00 committed by Tim Abbott
parent aa0ecd79d6
commit d968179e54
3 changed files with 4 additions and 27 deletions

View File

@ -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

View File

@ -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

View File

@ -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"