mirror of https://github.com/zulip/zulip.git
py3: Fix up (almost) all script invocations to rely on shebangs.
This follows up on 207cf6302
from last year to clean up cases that
have apparently popped up since then. Invoking the scripts directly
makes a cleaner command line in any case, and moreover is essential
to how we control running a Zulip install as either Python 2 or 3
(soon, how we always ensure it runs as Python 3.)
One exception: we're currently forcing `provision` in dev to run
Python 3, while still running both Python 2 and Python 3 jobs in CI.
We use a non-shebang invocation to do the forcing of Python 3.
This commit is contained in:
parent
67745f849b
commit
e469578a55
|
@ -85,9 +85,9 @@ semantic conflicts with the new changes from master:
|
|||
<output skipped>
|
||||
|
||||
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'
|
||||
|
||||
<output skipped>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
"""
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue