mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8266b99d1e | |||
| e27470778c | |||
| 8ef4a006e0 | |||
| 4fdaf14ded | |||
| f1da8d4b5c | |||
| eb9689c0a2 | |||
| 6fe7c6bde0 | |||
| a1b372ac66 | |||
| ddead6457a | |||
| 92b4385890 | |||
| 7074d5cb50 | |||
| 2b1f1182c3 | |||
| 38fc8f4fe7 | |||
| a203495532 | |||
| 33a69d7f52 | |||
| fe3f12c430 | |||
| aeb1a297d3 | |||
| 4c1972c0b9 | |||
| 74f0f319dc | |||
| 683bba59d7 | |||
| f890cdb889 |
@@ -3,3 +3,8 @@
|
||||
|
||||
tests:
|
||||
./bin/test
|
||||
|
||||
tools:
|
||||
git clone https://github.com/kennethreitz/pip-pop.git
|
||||
mv pip-pop/bin/* vendor/pip-pop/
|
||||
rm -fr pip-pop
|
||||
@@ -17,7 +17,7 @@ Example usage:
|
||||
$ git push heroku master
|
||||
...
|
||||
-----> Python app detected
|
||||
-----> Installing runtime (python-2.7.8)
|
||||
-----> Installing runtime (python-2.7.9)
|
||||
-----> Installing dependencies using pip
|
||||
Downloading/unpacking requests (from -r requirements.txt (line 1))
|
||||
Installing collected packages: requests
|
||||
@@ -28,7 +28,7 @@ Example usage:
|
||||
|
||||
You can also add it to upcoming builds of an existing application:
|
||||
|
||||
$ heroku config:add BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-python.git
|
||||
$ heroku buildpack:set git://github.com/heroku/heroku-buildpack-python.git
|
||||
|
||||
The buildpack will detect your app as Python if it has the file `requirements.txt` in the root.
|
||||
|
||||
@@ -40,12 +40,12 @@ Specify a Runtime
|
||||
You can also provide arbitrary releases Python with a `runtime.txt` file.
|
||||
|
||||
$ cat runtime.txt
|
||||
python-3.4.2
|
||||
python-3.4.3
|
||||
|
||||
Runtime options include:
|
||||
|
||||
- python-2.7.8
|
||||
- python-3.4.2
|
||||
- python-2.7.9
|
||||
- python-3.4.3
|
||||
- pypy-2.4.0 (unsupported, experimental)
|
||||
- pypy3-2.4.0 (unsupported, experimental)
|
||||
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh"
|
||||
DEFAULT_PYTHON_VERSION="python-2.7.9"
|
||||
DEFAULT_PYTHON_STACK="cedar"
|
||||
PYTHON_EXE="/app/.heroku/python/bin/python"
|
||||
PIP_VERSION="6.0.6"
|
||||
SETUPTOOLS_VERSION="11.3.1"
|
||||
PIP_VERSION="6.1.1"
|
||||
SETUPTOOLS_VERSION="15.2"
|
||||
|
||||
# Setup bpwatch
|
||||
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
source $BIN_DIR/utils
|
||||
|
||||
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' | head -1)
|
||||
MANAGE_FILE=$(find . -maxdepth 3 -type f -name 'manage.py' -printf '%d\t%P\n' | sort -nk1 | cut -f2 | head -1)
|
||||
MANAGE_FILE=${MANAGE_FILE:-fakepath}
|
||||
|
||||
[ -f .heroku/collectstatic_disabled ] && DISABLE_COLLECTSTATIC=1
|
||||
@@ -33,4 +33,4 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
bpwatch stop collectstatic
|
||||
bpwatch stop collectstatic
|
||||
|
||||
@@ -20,7 +20,7 @@ source $BIN_DIR/utils
|
||||
bpwatch start libffi_install
|
||||
|
||||
# If pylibmc exists within requirements, use vendored cryptography.
|
||||
if (pip-grep -s requirements.txt bcrypt cffi cryptography PyOpenSSL &> /dev/null) then
|
||||
if (pip-grep -s requirements.txt bcrypt cffi cryptography pyOpenSSL PyOpenSSL &> /dev/null) then
|
||||
|
||||
if [ -d ".heroku/vendor/lib/libffi-3.1.1" ]; then
|
||||
export LIBFFI=$(pwd)/vendor
|
||||
|
||||
@@ -5,7 +5,7 @@ if [[ -f .heroku/python/requirements-declared.txt ]]; then
|
||||
|
||||
cp .heroku/python/requirements-declared.txt requirements-declared.txt
|
||||
|
||||
pip-diff --stale requirements-declared.txt requirements.txt > .heroku/python/requirements-stale.txt
|
||||
pip-diff --stale requirements-declared.txt requirements.txt --exclude setuptools pip > .heroku/python/requirements-stale.txt
|
||||
|
||||
rm -fr requirements-declared.txt
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ set-default-env() {
|
||||
echo "export $1=\${$1:-$2}" >> $PROFILE_PATH
|
||||
}
|
||||
|
||||
# Usage: $ set-default-env key value
|
||||
# Usage: $ un-set-env key
|
||||
un-set-env() {
|
||||
echo "unset $1" >> $PROFILE_PATH
|
||||
}
|
||||
@@ -68,7 +68,7 @@ deep-rm() {
|
||||
# subshell to avoid surprising caller with shopts.
|
||||
(
|
||||
shopt -s dotglob
|
||||
rm -rf "$1"/!(tmp|.|..)
|
||||
rm -rf "$1"/!(.curlrc|.netrc|tmp|.|..)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build Path: /app/.heroku/python/
|
||||
# Build Deps: libraries/sqlite
|
||||
|
||||
# NOTICE: This formula only works for the cedar-14 stack, not cedar.
|
||||
|
||||
OUT_PREFIX=$1
|
||||
|
||||
echo "Building PyPy..."
|
||||
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux64.tar.bz2'
|
||||
curl -L $SOURCE_TARBALL | tar jx
|
||||
cp -R pypy-2.5.0-linux64/* $OUT_PREFIX
|
||||
|
||||
ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build Path: /app/.heroku/python/
|
||||
# Build Deps: libraries/sqlite
|
||||
|
||||
# NOTICE: This formula only works for the cedar-14 stack, not cedar.
|
||||
|
||||
OUT_PREFIX=$1
|
||||
|
||||
echo "Building PyPy..."
|
||||
SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.1-linux64.tar.bz2'
|
||||
curl -L $SOURCE_TARBALL | tar jx
|
||||
cp -R pypy-2.5.1-linux64/* $OUT_PREFIX
|
||||
|
||||
ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+9
-7
@@ -2,7 +2,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""Usage:
|
||||
pip-diff (--fresh | --stale) <reqfile1> <reqfile2>
|
||||
pip-diff (--fresh | --stale) <reqfile1> <reqfile2> [--exclude <package>...]
|
||||
pip-diff (-h | --help)
|
||||
|
||||
Options:
|
||||
@@ -41,7 +41,7 @@ class Requirements(object):
|
||||
self.requirements.append(requirement.req)
|
||||
|
||||
|
||||
def diff(self, requirements, ignore_versions=False):
|
||||
def diff(self, requirements, ignore_versions=False, excludes=None):
|
||||
r1 = self
|
||||
r2 = requirements
|
||||
results = {'fresh': [], 'stale': []}
|
||||
@@ -55,7 +55,7 @@ class Requirements(object):
|
||||
for req in r2.requirements:
|
||||
r = req.project_name if ignore_versions else req
|
||||
|
||||
if r not in other_reqs:
|
||||
if r not in other_reqs and r not in excludes:
|
||||
results['fresh'].append(req)
|
||||
|
||||
# Generate stale packages.
|
||||
@@ -67,7 +67,7 @@ class Requirements(object):
|
||||
for req in r1.requirements:
|
||||
r = req.project_name if ignore_versions else req
|
||||
|
||||
if r not in other_reqs:
|
||||
if r not in other_reqs and r not in excludes:
|
||||
results['stale'].append(req)
|
||||
|
||||
return results
|
||||
@@ -76,9 +76,10 @@ class Requirements(object):
|
||||
|
||||
|
||||
|
||||
def diff(r1, r2, include_fresh=False, include_stale=False):
|
||||
def diff(r1, r2, include_fresh=False, include_stale=False, excludes=None):
|
||||
|
||||
include_versions = True if include_stale else False
|
||||
excludes = excludes if len(excludes) else []
|
||||
|
||||
try:
|
||||
r1 = Requirements(r1)
|
||||
@@ -87,7 +88,7 @@ def diff(r1, r2, include_fresh=False, include_stale=False):
|
||||
print('There was a problem loading the given requirements files.')
|
||||
exit(os.EX_NOINPUT)
|
||||
|
||||
results = r1.diff(r2, ignore_versions=True)
|
||||
results = r1.diff(r2, ignore_versions=True, excludes=excludes)
|
||||
|
||||
if include_fresh:
|
||||
for line in results['fresh']:
|
||||
@@ -106,7 +107,8 @@ def main():
|
||||
'r1': args['<reqfile1>'],
|
||||
'r2': args['<reqfile2>'],
|
||||
'include_fresh': args['--fresh'],
|
||||
'include_stale': args['--stale']
|
||||
'include_stale': args['--stale'],
|
||||
'excludes': args['<package>']
|
||||
}
|
||||
|
||||
diff(**kwargs)
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user