mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9108858fc | |||
| c85f5d015c | |||
| 321543d4ae | |||
| 8bd209de13 | |||
| 58e9c84347 | |||
| dcfff15151 | |||
| 9426dc8668 | |||
| cdbeb6419e | |||
| 858113cf76 | |||
| a547da0b52 | |||
| df52fd46e5 | |||
| 2e37a96984 | |||
| 12c3b8cb1d | |||
| 0fadebf7d8 | |||
| 33ccaa9e45 | |||
| 6b5ec50ab9 | |||
| 63810f29d3 | |||
| 0de749a6a2 | |||
| 2df1131d3c | |||
| af0795264b | |||
| 327daa5f32 | |||
| 09b7e44841 | |||
| e26a0f04d9 | |||
| c92f379f78 | |||
| 893bdec066 | |||
| 607dcfda07 | |||
| 26a0b9678f | |||
| e58e5d2b74 | |||
| 6faa5a4efc | |||
| 2881d65e4e | |||
| 1696e7cee6 | |||
| 35b89386ed | |||
| 3634eb1dbf | |||
| 66f5a66740 | |||
| 6e2a504fc1 | |||
| 124aff5ea6 | |||
| c44ab4cd03 | |||
| d1ab87748b | |||
| 6844d1252d | |||
| 1346c29089 | |||
| 3bc1b5e697 |
@@ -1,2 +1,3 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
site
|
site
|
||||||
|
.DS_Store
|
||||||
|
|||||||
+5
-2
@@ -2,5 +2,8 @@ language: bash
|
|||||||
sudo: required
|
sudo: required
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
install: docker pull heroku/cedar:14
|
# install: docker pull heroku/cedar:14
|
||||||
script: make test
|
script: ./tests.sh
|
||||||
|
env:
|
||||||
|
- STACK=heroku-16
|
||||||
|
- STACK=cedar-14
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
# Python Buildpack Changelog
|
# Python Buildpack Changelog
|
||||||
|
|
||||||
|
## 100
|
||||||
|
|
||||||
|
Preliminary pipenv support.
|
||||||
|
|
||||||
|
## 99
|
||||||
|
|
||||||
|
Cleanup.
|
||||||
|
|
||||||
## 98
|
## 98
|
||||||
|
|
||||||
Official NLTK support and other improvements.
|
Official NLTK support and other improvements.
|
||||||
|
|||||||
+12
-7
@@ -42,7 +42,7 @@ export WARNINGS_LOG=$(mktemp)
|
|||||||
export RECOMMENDED_PYTHON_VERSION=$DEFAULT_PYTHON_VERSION
|
export RECOMMENDED_PYTHON_VERSION=$DEFAULT_PYTHON_VERSION
|
||||||
|
|
||||||
# Setup bpwatch
|
# Setup bpwatch
|
||||||
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
export PATH=$PATH:$ROOT_DIR/vendor/:$ROOT_DIR/vendor/bpwatch
|
||||||
LOGPLEX_KEY="t.b90d9d29-5388-4908-9737-b4576af1d4ce"
|
LOGPLEX_KEY="t.b90d9d29-5388-4908-9737-b4576af1d4ce"
|
||||||
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
|
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
|
||||||
BUILDPACK_VERSION=v28
|
BUILDPACK_VERSION=v28
|
||||||
@@ -107,12 +107,6 @@ bpwatch start pre_compile
|
|||||||
source $BIN_DIR/steps/hooks/pre_compile
|
source $BIN_DIR/steps/hooks/pre_compile
|
||||||
bpwatch stop 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.
|
# Sticky runtimes.
|
||||||
if [ -f $CACHE_DIR/.heroku/python-version ]; then
|
if [ -f $CACHE_DIR/.heroku/python-version ]; then
|
||||||
DEFAULT_PYTHON_VERSION=$(cat $CACHE_DIR/.heroku/python-version)
|
DEFAULT_PYTHON_VERSION=$(cat $CACHE_DIR/.heroku/python-version)
|
||||||
@@ -125,6 +119,9 @@ else
|
|||||||
CACHED_PYTHON_STACK=$STACK
|
CACHED_PYTHON_STACK=$STACK
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Pipenv Python version support.
|
||||||
|
source $BIN_DIR/steps/pipenv-python-version
|
||||||
|
|
||||||
# If no runtime given, assume default version.
|
# If no runtime given, assume default version.
|
||||||
if [ ! -f runtime.txt ]; then
|
if [ ! -f runtime.txt ]; then
|
||||||
echo $DEFAULT_PYTHON_VERSION > runtime.txt
|
echo $DEFAULT_PYTHON_VERSION > runtime.txt
|
||||||
@@ -172,6 +169,14 @@ source $BIN_DIR/steps/python
|
|||||||
# Sanity check for setuptools/distribute.
|
# Sanity check for setuptools/distribute.
|
||||||
source $BIN_DIR/steps/setuptools
|
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.
|
# Uninstall removed dependencies with Pip.
|
||||||
source $BIN_DIR/steps/pip-uninstall
|
source $BIN_DIR/steps/pip-uninstall
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
BUILD_DIR=$1
|
BUILD_DIR=$1
|
||||||
|
|
||||||
# Exit early if app is clearly not Python.
|
# Exit early if app is clearly not Python.
|
||||||
if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ]; then
|
if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ] && [ ! -f $BUILD_DIR/Pipfile ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ if [ $? -eq 0 ]; then
|
|||||||
else
|
else
|
||||||
puts-warn "nltk.txt not found, not downloading any corpora"
|
puts-warn "nltk.txt not found, not downloading any corpora"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
puts-warn "nltk not apparently installed, not downloading packages"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
# 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
|
curl -L $SOURCE_TARBALL | tar zx
|
||||||
|
|
||||||
cd gdal-1.11.1
|
cd gdal-1.11.1
|
||||||
./configure --prefix=$OUT_PREFIX &&
|
./configure --prefix=$OUT_PREFIX --enable-static=no &&
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -10,12 +10,12 @@ hash -r
|
|||||||
|
|
||||||
echo "Building geos..."
|
echo "Building geos..."
|
||||||
|
|
||||||
SOURCE_TARBALL='http://download.osgeo.org/geos/geos-3.4.2.tar.bz2'
|
SOURCE_TARBALL='http://download.osgeo.org/geos/geos-3.4.3.tar.bz2'
|
||||||
|
|
||||||
curl -L $SOURCE_TARBALL | tar xj
|
curl -L $SOURCE_TARBALL | tar xj
|
||||||
|
|
||||||
cd geos-3.4.2
|
cd geos-3.4.3
|
||||||
./configure --prefix=$OUT_PREFIX &&
|
./configure --prefix=$OUT_PREFIX --enable-static=no &&
|
||||||
make
|
make
|
||||||
make install
|
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
|
curl -L $SOURCE_TARBALL | tar zx
|
||||||
|
|
||||||
cd proj-4.8.0
|
cd proj-4.8.0
|
||||||
./configure --prefix=$OUT_PREFIX &&
|
./configure --prefix=$OUT_PREFIX --enable-static=no &&
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#!/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
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/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