mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b2c0b5df9 | |||
| 49b9eaa93e |
@@ -1,3 +1,2 @@
|
||||
*.pyc
|
||||
site
|
||||
.DS_Store
|
||||
|
||||
+2
-5
@@ -2,8 +2,5 @@ language: bash
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
# install: docker pull heroku/cedar:14
|
||||
script: ./tests.sh
|
||||
env:
|
||||
- STACK=heroku-16
|
||||
- STACK=cedar-14
|
||||
install: docker pull heroku/cedar:14
|
||||
script: make test
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# Python Buildpack Changelog
|
||||
|
||||
## 100
|
||||
|
||||
Preliminary pipenv support.
|
||||
|
||||
## 99
|
||||
|
||||
Cleanup.
|
||||
|
||||
+7
-12
@@ -42,7 +42,7 @@ export WARNINGS_LOG=$(mktemp)
|
||||
export RECOMMENDED_PYTHON_VERSION=$DEFAULT_PYTHON_VERSION
|
||||
|
||||
# Setup bpwatch
|
||||
export PATH=$PATH:$ROOT_DIR/vendor/:$ROOT_DIR/vendor/bpwatch
|
||||
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
||||
LOGPLEX_KEY="t.b90d9d29-5388-4908-9737-b4576af1d4ce"
|
||||
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
|
||||
BUILDPACK_VERSION=v28
|
||||
@@ -107,6 +107,12 @@ bpwatch start pre_compile
|
||||
source $BIN_DIR/steps/hooks/pre_compile
|
||||
bpwatch stop pre_compile
|
||||
|
||||
# If no requirements.txt file given, assume `setup.py develop` is intended.
|
||||
if [ ! -f requirements.txt ]; then
|
||||
echo "-e ." > requirements.txt
|
||||
fi
|
||||
|
||||
|
||||
# Sticky runtimes.
|
||||
if [ -f $CACHE_DIR/.heroku/python-version ]; then
|
||||
DEFAULT_PYTHON_VERSION=$(cat $CACHE_DIR/.heroku/python-version)
|
||||
@@ -119,9 +125,6 @@ else
|
||||
CACHED_PYTHON_STACK=$STACK
|
||||
fi
|
||||
|
||||
# Pipenv Python version support.
|
||||
source $BIN_DIR/steps/pipenv-python-version
|
||||
|
||||
# If no runtime given, assume default version.
|
||||
if [ ! -f runtime.txt ]; then
|
||||
echo $DEFAULT_PYTHON_VERSION > runtime.txt
|
||||
@@ -169,14 +172,6 @@ source $BIN_DIR/steps/python
|
||||
# Sanity check for setuptools/distribute.
|
||||
source $BIN_DIR/steps/setuptools
|
||||
|
||||
# Pipenv support.
|
||||
source $BIN_DIR/steps/pipenv
|
||||
|
||||
# If no requirements.txt file given, assume `setup.py develop` is intended.
|
||||
if [ ! -f requirements.txt ]; then
|
||||
echo "-e ." > requirements.txt
|
||||
fi
|
||||
|
||||
# Uninstall removed dependencies with Pip.
|
||||
source $BIN_DIR/steps/pip-uninstall
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
BUILD_DIR=$1
|
||||
|
||||
# Exit early if app is clearly not Python.
|
||||
if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ] && [ ! -f $BUILD_DIR/Pipfile ]; then
|
||||
if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# Generate requriements.txt with pipenv.
|
||||
|
||||
if [[ -f Pipfile ]]; then
|
||||
if [[ ! -f requirements.txt ]]; then
|
||||
puts-step "Generating 'requirements.txt' with pipenv"
|
||||
|
||||
pip install git+https://github.com/kennethreitz/pipenv.git#egg=pipenv &> /dev/null
|
||||
pipenv lock --requirements > requirements.txt 2> /dev/null
|
||||
|
||||
pipstrip requirements.txt
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# Detect Python-version with Pipenv.
|
||||
|
||||
if [[ -f $BUILD_DIR/Pipfile.lock ]]; then
|
||||
|
||||
if [[ ! -f $BUILD_DIR/runtime.txt ]]; then
|
||||
if [[ ! -f Pipfile.lock ]]; then
|
||||
pipenv lock 2> /dev/null
|
||||
fi
|
||||
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ SOURCE_TARBALL='http://download.osgeo.org/gdal/1.11.1/gdal-1.11.1.tar.gz'
|
||||
curl -L $SOURCE_TARBALL | tar zx
|
||||
|
||||
cd gdal-1.11.1
|
||||
./configure --prefix=$OUT_PREFIX --enable-static=no &&
|
||||
./configure --prefix=$OUT_PREFIX &&
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -10,12 +10,12 @@ hash -r
|
||||
|
||||
echo "Building geos..."
|
||||
|
||||
SOURCE_TARBALL='http://download.osgeo.org/geos/geos-3.4.3.tar.bz2'
|
||||
SOURCE_TARBALL='http://download.osgeo.org/geos/geos-3.4.2.tar.bz2'
|
||||
|
||||
curl -L $SOURCE_TARBALL | tar xj
|
||||
|
||||
cd geos-3.4.3
|
||||
./configure --prefix=$OUT_PREFIX --enable-static=no &&
|
||||
cd geos-3.4.2
|
||||
./configure --prefix=$OUT_PREFIX &&
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ SOURCE_TARBALL='http://download.osgeo.org/proj/proj-4.8.0.tar.gz'
|
||||
curl -L $SOURCE_TARBALL | tar zx
|
||||
|
||||
cd proj-4.8.0
|
||||
./configure --prefix=$OUT_PREFIX --enable-static=no &&
|
||||
./configure --prefix=$OUT_PREFIX &&
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ ! "$STACK" ]]; then
|
||||
echo '$STACK must be set! (heroku-16 | cedar-14)'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$STACK" == "cedar-14" ]]; then
|
||||
make test-cedar-14
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [[ "$STACK" == "heroku-16" ]]; then
|
||||
make test-heroku-16
|
||||
exit $?
|
||||
fi
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
req_file = sys.argv[1]
|
||||
|
||||
lines = []
|
||||
|
||||
with open(req_file, 'r') as f:
|
||||
r = f.readlines()
|
||||
for l in r:
|
||||
lines.append(l.split('--hash')[0])
|
||||
|
||||
with open(req_file, 'w') as f:
|
||||
f.write('\n'.join(lines))
|
||||
Reference in New Issue
Block a user