diff --git a/docs/migration-renumbering.md b/docs/migration-renumbering.md index 4f37637ffb..1f81387563 100644 --- a/docs/migration-renumbering.md +++ b/docs/migration-renumbering.md @@ -85,9 +85,9 @@ semantic conflicts with the new changes from master: File "/srv/zulip-venv-cache/ad3a375e95a56d911510d7edba7e17280d227bc7/zulip-venv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 105, in handle - "'python manage.py makemigrations --merge'" % name_str + "'./manage.py makemigrations --merge'" % name_str django.core.management.base.CommandError: Conflicting migrations detected (0026_topics_backfill, 0025_realm_message_content_edit_limit in zerver). -To fix them run 'python manage.py makemigrations --merge' +To fix them run './manage.py makemigrations --merge' diff --git a/puppet/zulip/files/cron.d/update-analytics-counts b/puppet/zulip/files/cron.d/update-analytics-counts index 68404c7a07..b5b9b4e4b7 100644 --- a/puppet/zulip/files/cron.d/update-analytics-counts +++ b/puppet/zulip/files/cron.d/update-analytics-counts @@ -3,5 +3,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin USER=zulip # Run update analytics tables every 5 minutes past the hour -5 * * * * zulip python /home/zulip/deployments/current/manage.py update_analytics_counts +5 * * * * zulip /home/zulip/deployments/current/manage.py update_analytics_counts diff --git a/tools/js-dep-visualizer.py b/tools/js-dep-visualizer.py old mode 100644 new mode 100755 index eacb909c2d..232c32a4f0 --- a/tools/js-dep-visualizer.py +++ b/tools/js-dep-visualizer.py @@ -1,5 +1,6 @@ +#!/usr/bin/env python """ -$ python ./tools/js-dep-visualizer.py +$ ./tools/js-dep-visualizer.py $ dot -Tpng var/zulip-deps.dot -o var/zulip-deps.png """ diff --git a/tools/provision b/tools/provision index babfa5bfbb..e5fdb16538 100755 --- a/tools/provision +++ b/tools/provision @@ -10,26 +10,28 @@ if [ "$EUID" -eq 0 ]; then exit 1 fi -if [ -n "$TRAVIS" ]; then - PYTHON=python -else - PYTHON=python3 -fi - #Make the script independent of the location from where it is #executed PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) cd "$PARENT_PATH" mkdir -p ../var/log LOG_PATH="../var/log/provision.log" -PROVISION_PATH="lib/provision.py" 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 -"$PYTHON" "$PROVISION_PATH" "$@" 2>&1 | tee -a "$LOG_PATH" +"${PROVISION_CMD[@]}" "$@" 2>&1 | tee -a "$LOG_PATH" failed=${PIPESTATUS[0]} if [ $failed = 1 ]; then diff --git a/tools/test-all b/tools/test-all index 7a0bff7ed0..f238449704 100755 --- a/tools/test-all +++ b/tools/test-all @@ -41,9 +41,9 @@ run ./tools/run-mypy # travis/backend run ./tools/lint --pep8 $FORCEARG -run python manage.py makemessages --locale en -run python -W ignore tools/check-capitalization --no-generate -run python -W ignore tools/check-frontend-i18n --no-generate +run ./manage.py makemessages --locale en +run PYTHONWARNINGS=ignore ./tools/check-capitalization --no-generate +run PYTHONWARNINGS=ignore ./tools/check-frontend-i18n --no-generate run ./tools/test-tools run ./tools/test-backend $FORCEARG run ./tools/test-migrations diff --git a/tools/travis/backend b/tools/travis/backend index 67ee5a4563..18685b81b8 100755 --- a/tools/travis/backend +++ b/tools/travis/backend @@ -6,9 +6,9 @@ set -e set -x ./tools/lint --pep8 # Include the slow and thus non-default pep8 linter check -python manage.py makemessages --locale en -python -W ignore tools/check-capitalization --no-generate -python -W ignore tools/check-frontend-i18n --no-generate +./manage.py makemessages --locale en +PYTHONWARNINGS=ignore ./tools/check-capitalization --no-generate +PYTHONWARNINGS=ignore ./tools/check-frontend-i18n --no-generate ./tools/test-tools ./tools/test-backend --coverage