Permalink
Browse files

Add a check for Python 2.7 in build/dev.sh.

Addresses issue #97, e.g. for Arch Linux.
  • Loading branch information...
Andy Chu
Andy Chu committed Aug 14, 2018
1 parent 9a06a0f commit d81643c10cffc4cb971b0eaaaf3fde0d9bc4d1c7
Showing with 17 additions and 0 deletions.
  1. +17 −0 build/dev.sh
View
@@ -16,6 +16,23 @@ set -o errexit
source test/common.sh # R_PATH
# In some distros, 'python' is python3, which confuses first-time developers.
# https://github.com/oilshell/oil/issues/97
readonly PYTHON_VERSION="$(python --version 2>&1)"
# bash weirdness: VERSION_REGEX must NOT be inline in the expression, and must
# NOT be quoted.
readonly VERSION_REGEX='Python (2\.7\.[0-9]+)'
if [[ "${PYTHON_VERSION}" =~ $VERSION_REGEX ]]; then
true
else
echo >&2 'FATAL: Oil dev requires Python 2.7.*'
echo >&2 "But you have '${PYTHON_VERSION}'"
echo >&2 'Hint: Use virtualenv to create a Python 2.7 environment.'
exit 1
fi
ubuntu-deps() {
# python-dev: for pylibc
# gawk: used by spec-runner.sh for the special match() function.

0 comments on commit d81643c

Please sign in to comment.