mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 194932889d | |||
| 4293ec5564 | |||
| 57baab9f68 | |||
| a7c20eea42 | |||
| 0a4cc2c476 | |||
| cbb718bb8b |
@@ -1,5 +1,11 @@
|
|||||||
# Python Buildpack Changelog
|
# Python Buildpack Changelog
|
||||||
|
|
||||||
|
# 110
|
||||||
|
|
||||||
|
Update Default Python to 3.6.1, bugfixes.
|
||||||
|
|
||||||
|
- Fixed automatic pip uninstall of dependencies removed from requirements.txt.
|
||||||
|
|
||||||
# 109
|
# 109
|
||||||
|
|
||||||
Fix output for collectstatic step.
|
Fix output for collectstatic step.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ This is the official [Heroku buildpack](https://devcenter.heroku.com/articles/bu
|
|||||||
|
|
||||||
Recommended web frameworks include **Django** and **Flask**. The recommended webserver is **Gunicorn**. There are no restrictions around what software can be used (as long as it's pip-installable). Web processes must bind to `$PORT`, and only the HTTP protocol is permitted for incoming connections.
|
Recommended web frameworks include **Django** and **Flask**. The recommended webserver is **Gunicorn**. There are no restrictions around what software can be used (as long as it's pip-installable). Web processes must bind to `$PORT`, and only the HTTP protocol is permitted for incoming connections.
|
||||||
|
|
||||||
Some Python packages with obscure C dependencies (e.g. scipy) are [not compatible](https://devcenter.heroku.com/articles/python-c-deps).
|
Some Python packages with obscure C dependencies are [not compatible](https://devcenter.heroku.com/articles/python-c-deps).
|
||||||
|
|
||||||
See it in Action
|
See it in Action
|
||||||
----------------
|
----------------
|
||||||
@@ -23,7 +23,7 @@ Deploying a Python application couldn't be easier:
|
|||||||
$ git push heroku master
|
$ git push heroku master
|
||||||
...
|
...
|
||||||
-----> Python app detected
|
-----> Python app detected
|
||||||
-----> Installing python-2.7.13
|
-----> Installing python-3.6.2
|
||||||
$ pip install -r requirements.txt
|
$ pip install -r requirements.txt
|
||||||
Collecting requests (from -r requirements.txt (line 1))
|
Collecting requests (from -r requirements.txt (line 1))
|
||||||
Downloading requests-2.12.4-py2.py3-none-any.whl (576KB)
|
Downloading requests-2.12.4-py2.py3-none-any.whl (576KB)
|
||||||
@@ -46,11 +46,11 @@ Specify a Python Runtime
|
|||||||
Specific versions of the Python runtime can be specified with a `runtime.txt` file:
|
Specific versions of the Python runtime can be specified with a `runtime.txt` file:
|
||||||
|
|
||||||
$ cat runtime.txt
|
$ cat runtime.txt
|
||||||
python-3.6.1
|
python-2.7.13
|
||||||
|
|
||||||
Runtime options include:
|
Runtime options include:
|
||||||
|
|
||||||
|
- `python-3.6.2`
|
||||||
- `python-2.7.13`
|
- `python-2.7.13`
|
||||||
- `python-3.6.1`
|
|
||||||
- `pypy-5.7.1` (unsupported, experimental)
|
- `pypy-5.7.1` (unsupported, experimental)
|
||||||
- `pypy3-5.5.1` (unsupported, experimental)
|
- `pypy3-5.5.1` (unsupported, experimental)
|
||||||
|
|||||||
+6
-6
@@ -32,7 +32,7 @@ CACHE_DIR=$2
|
|||||||
ENV_DIR=$3
|
ENV_DIR=$3
|
||||||
|
|
||||||
# Python defaults
|
# Python defaults
|
||||||
DEFAULT_PYTHON_VERSION="python-2.7.13"
|
DEFAULT_PYTHON_VERSION="python-3.6.2"
|
||||||
DEFAULT_PYTHON_STACK="cedar-14"
|
DEFAULT_PYTHON_STACK="cedar-14"
|
||||||
PYTHON_EXE="/app/.heroku/python/bin/python"
|
PYTHON_EXE="/app/.heroku/python/bin/python"
|
||||||
PIP_VERSION="9.0.1"
|
PIP_VERSION="9.0.1"
|
||||||
@@ -170,16 +170,16 @@ sub-env $BIN_DIR/steps/geo-libs
|
|||||||
# GDAL support.
|
# GDAL support.
|
||||||
source $BIN_DIR/steps/gdal
|
source $BIN_DIR/steps/gdal
|
||||||
|
|
||||||
# Install dependencies with Pip (where the magic happens).
|
|
||||||
let start=$(nowms)
|
|
||||||
source $BIN_DIR/steps/pip-install
|
|
||||||
mtime "pip.install.time" "${start}"
|
|
||||||
|
|
||||||
# Uninstall removed dependencies with Pip.
|
# Uninstall removed dependencies with Pip.
|
||||||
let start=$(nowms)
|
let start=$(nowms)
|
||||||
source $BIN_DIR/steps/pip-uninstall
|
source $BIN_DIR/steps/pip-uninstall
|
||||||
mtime "pip.uninstall.time" "${start}"
|
mtime "pip.uninstall.time" "${start}"
|
||||||
|
|
||||||
|
# Install dependencies with Pip (where the magic happens).
|
||||||
|
let start=$(nowms)
|
||||||
|
source $BIN_DIR/steps/pip-install
|
||||||
|
mtime "pip.install.time" "${start}"
|
||||||
|
|
||||||
# Support for NLTK corpora.
|
# Support for NLTK corpora.
|
||||||
let start=$(nowms)
|
let start=$(nowms)
|
||||||
sub-env $BIN_DIR/steps/nltk
|
sub-env $BIN_DIR/steps/nltk
|
||||||
|
|||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build Path: /app/.heroku/python/
|
||||||
|
# Build Deps: libraries/sqlite
|
||||||
|
|
||||||
|
OUT_PREFIX=$1
|
||||||
|
|
||||||
|
echo "Building PyPy..."
|
||||||
|
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.8.0-linux64.tar.bz2'
|
||||||
|
curl -L $SOURCE_TARBALL | tar jx
|
||||||
|
cp -R pypy3-v5.8.0-linux64/* $OUT_PREFIX
|
||||||
|
|
||||||
|
ln $OUT_PREFIX/bin/pypy3 $OUT_PREFIX/bin/python
|
||||||
Executable
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build Path: /app/.heroku/python/
|
||||||
|
# Build Deps: libraries/sqlite
|
||||||
|
|
||||||
|
OUT_PREFIX=$1
|
||||||
|
|
||||||
|
echo "Building Python..."
|
||||||
|
SOURCE_TARBALL='https://python.org/ftp/python/3.6.2/Python-3.6.2.tgz'
|
||||||
|
curl -L $SOURCE_TARBALL | tar xz
|
||||||
|
mv Python-3.6.2 src
|
||||||
|
cd src
|
||||||
|
|
||||||
|
./configure --prefix=$OUT_PREFIX --with-ensurepip=no
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
|
||||||
|
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
python-2.7.13
|
||||||
@@ -62,6 +62,16 @@ testPython3() {
|
|||||||
assertCapturedSuccess
|
assertCapturedSuccess
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testSmartRequirements() {
|
||||||
|
local cache_dir="$(mktmpdir)"
|
||||||
|
compile "requirements-standard" "$cache_dir"
|
||||||
|
assertFile "requests" ".heroku/python/requirements-declared.txt"
|
||||||
|
assertCapturedSuccess
|
||||||
|
compile "psycopg2" "$cache_dir"
|
||||||
|
assertCaptured "Uninstalling requests"
|
||||||
|
assertFile "psycopg2" ".heroku/python/requirements-declared.txt"
|
||||||
|
assertCapturedSuccess
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user