mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
v100
This commit is contained in:
@@ -1,26 +1,22 @@
|
||||
# Detect Python-version with Pipenv.
|
||||
|
||||
if [[ -f $BUILD_DIR/Pipfile ]]; then
|
||||
if [[ -f $BUILD_DIR/Pipfile.lock ]]; then
|
||||
|
||||
if [[ ! -f $BUILD_DIR/runtime.txt ]]; then
|
||||
if [[ ! -f Pipfile.lock ]]; then
|
||||
puts-warn "Pipfile.lock not found!"
|
||||
echo '{}' > Pipfile.lock
|
||||
pipenv lock 2> /dev/null
|
||||
fi
|
||||
|
||||
if [[ -f Pipfile.lock ]]; then
|
||||
set +e
|
||||
PYTHON=$(cat $BUILD_DIR/Pipfile.lock | jq '._meta.requires.python_version' -r)
|
||||
set -e
|
||||
set +e
|
||||
PYTHON=$(cat $BUILD_DIR/Pipfile.lock | jq '._meta.requires.python_version' -r)
|
||||
set -e
|
||||
|
||||
if [ "$PYTHON" = 2.7 ]; then
|
||||
echo "python-2.7.13" > $BUILD_DIR/runtime.txt
|
||||
fi
|
||||
if [ "$PYTHON" = 3.6 ]; then
|
||||
echo "python-3.6.0" > $BUILD_DIR/runtime.txt
|
||||
fi
|
||||
if [ "$PYTHON" = 2.7 ]; then
|
||||
echo "python-2.7.13" > $BUILD_DIR/runtime.txt
|
||||
fi
|
||||
if [ "$PYTHON" = 3.6 ]; then
|
||||
echo "python-3.6.0" > $BUILD_DIR/runtime.txt
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user