|
|
|
@ -33,11 +33,18 @@ if [ -n "${NOCOMPILE:-}" ]; then
|
|
|
|
|
elif [ -n "${QUICK:-}" ]; then
|
|
|
|
|
echo '$QUICK environment variable set, skipping python compile'
|
|
|
|
|
else
|
|
|
|
|
for x in $(find "${1:-.}" -maxdepth 2 -type f -iname '*.py' -o -iname '*.jy' | sort); do
|
|
|
|
|
type isExcluded &>/dev/null && isExcluded "$x" && continue
|
|
|
|
|
echo "compiling $x"
|
|
|
|
|
python -m py_compile "$x"
|
|
|
|
|
done
|
|
|
|
|
if [ -n "${FAST:-}" ]; then
|
|
|
|
|
python -m compileall "${1:-.}" || :
|
|
|
|
|
else
|
|
|
|
|
for x in $(find "${1:-.}" -maxdepth 2 -type f -iname '*.py' -o -iname '*.jy' | sort); do
|
|
|
|
|
type isExcluded &>/dev/null && isExcluded "$x" && continue
|
|
|
|
|
echo "compiling $x"
|
|
|
|
|
# -O - optimize
|
|
|
|
|
# -3 - warn on Python 3 incompatibilies that 2to3 cannot easily fix
|
|
|
|
|
# -t - warn on inconsistent use of tabs
|
|
|
|
|
python -O -3 -t -m py_compile "$x"
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
time_taken "$start_time"
|
|
|
|
|