Compare commits

...

13 Commits

Author SHA1 Message Date
Kenneth Reitz 2bc071b323 python 3 compatibility 2014-08-05 13:33:12 -04:00
Kenneth Reitz 5c74244695 fix for cryptography detection 2014-08-04 13:11:05 -04:00
Kenneth Reitz 4e877e4f11 conanical source tarball 2014-08-04 12:11:29 -04:00
Kenneth Reitz 51ec7e3741 attempt of libffi 2014-08-01 21:19:44 -04:00
Kenneth Reitz 1f983fea40 libffi for cedar attempt 2014-08-01 21:12:30 -04:00
Kenneth Reitz a26f0374ec setuptools sanity check 2014-08-01 18:16:54 -04:00
Kenneth Reitz a0029a8411 suppress pip-grep errors 2014-08-01 18:10:15 -04:00
Kenneth Reitz 2de3b6cf1c remove debug statement 2014-08-01 18:04:46 -04:00
Kenneth Reitz fd19ec2c6a support for cryptography! 2014-08-01 18:00:49 -04:00
Kenneth Reitz 6aec3ed37a pylibmc 2014-08-01 17:56:44 -04:00
Kenneth Reitz 7f7f0f7e3d actual libffi support! 2014-08-01 17:37:26 -04:00
Kenneth Reitz dd210c9002 libffi support? 2014-08-01 17:32:17 -04:00
Kenneth Reitz 2ae4bd156f vendor dir for libffi 2014-08-01 16:58:17 -04:00
9 changed files with 92 additions and 17 deletions
+6
View File
@@ -150,6 +150,9 @@ mkdir -p $(dirname $PROFILE_PATH)
# Install Python.
source $BIN_DIR/steps/python
# Sanity check for setuptools/distribute.
source $BIN_DIR/steps/setuptools
# Uninstall removed dependencies with Pip.
source $BIN_DIR/steps/pip-uninstall
@@ -159,6 +162,9 @@ source $BIN_DIR/steps/mercurial
# Pylibmc support.
source $BIN_DIR/steps/pylibmc
# Libffi support.
source $BIN_DIR/steps/cryptography
# Install dependencies with Pip.
source $BIN_DIR/steps/pip-install
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# This script serves as the Pylibmc build step of the
# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python)
# compiler.
#
# A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an
# adapter between a Python application and Heroku's runtime.
#
# This script is invoked by [`bin/compile`](/).
# The location of the pre-compiled cryptography binary.
VENDORED_LIBFFI="http://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libffi.tar.gz"
PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH"
# Syntax sugar.
source $BIN_DIR/utils
bpwatch start libffi_install
# If pylibmc exists within requirements, use vendored cryptography.
if (pip-grep -s requirements.txt cffi crytography &> /dev/null) then
if [ -d ".heroku/vendor/lib/libffi-3.1.1" ]; then
export LIBFFI=$(pwd)/vendor
else
echo "-----> Noticed cffi. Bootstrapping libffi."
mkdir -p .heroku/vendor
# Download and extract cryptography into target vendor directory.
curl $VENDORED_LIBFFI -s | tar zxv -C .heroku/vendor &> /dev/null
export LIBFFI=$(pwd)/vendor
fi
fi
bpwatch stop libffi_install
+3 -2
View File
@@ -15,12 +15,13 @@ VENDORED_MEMCACHED="http://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/
# Syntax sugar.
source $BIN_DIR/utils
bpwatch start pylibmc_install
# If pylibmc exists within requirements, use vendored libmemcached.
if (pip-grep -s requirements.txt pylibmc) then
if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
if [ -d "vendor/lib/sasl2" ]; then
if [ -d ".heroku/vendor/lib/sasl2" ]; then
export LIBMEMCACHED=$(pwd)/vendor
else
echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Syntax sugar.
source $BIN_DIR/utils
if (pip-grep -s requirements.txt setuptools distribute &> /dev/null) then
puts-warn 'The package setuptools/distribute is listed in requirements.txt.'
puts-warn 'Please remove to ensure expected behavior. '
fi
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
OUT_PREFIX=$1
# Use new path, containing autoconf.
export PATH="/app/.heroku/python/bin/:$PATH"
hash -r
echo "Building libffi..."
SOURCE_TARBALL='http://cl.ly/2s1t1u3v0N0I/download/libffi-3.1.tar'
curl -L $SOURCE_TARBALL | tar x
cd libffi-3.1
./configure --prefix=$OUT_PREFIX --disable-static &&
make
make install
# Cleanup
cd ..
+5 -8
View File
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
# Build Deps: libraries/autoconf
# Build Path: /app/.heroku/vendor/
OUT_PREFIX=$1
@@ -11,14 +10,12 @@ hash -r
echo "Building libffi..."
SOURCE_TARBALL='https://github.com/atgreen/libffi/archive/master.tar.gz'
SOURCE_TARBALL='ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz'
curl -L $SOURCE_TARBALL | tar xz
mv libffi-master libffi
curl -L $SOURCE_TARBALL | tar x
cd libffi
./autogen.sh
./configure --prefix=$OUT_PREFIX --enable-shared
cd libffi-3.1
./configure --prefix=$OUT_PREFIX --disable-static &&
make
make install
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
# Build Deps: libraries/sqlite
# Build Deps: libraries/sqlite, libraries/libffi
# NOTICE: This formula only works for the cedar-14 stack, not cedar.
+3 -3
View File
@@ -79,18 +79,18 @@ def diff(r1, r2, include_fresh=False, include_stale=False):
r1 = Requirements(r1)
r2 = Requirements(r2)
except ValueError:
print 'There was a problem loading the given requirements files.'
print('There was a problem loading the given requirements files.')
exit(os.EX_NOINPUT)
results = r1.diff(r2, ignore_versions=True)
if include_fresh:
for line in results['fresh']:
print line.project_name if include_versions else line
print(line.project_name if include_versions else line)
if include_stale:
for line in results['stale']:
print line.project_name if include_versions else line
print(line.project_name if include_versions else line)
+3 -3
View File
@@ -41,7 +41,7 @@ def grep(reqfile, packages, silent=False):
except ValueError:
if not silent:
print 'There was a problem loading the given requirement file.'
print('There was a problem loading the given requirement file.')
exit(os.EX_NOINPUT)
@@ -52,12 +52,12 @@ def grep(reqfile, packages, silent=False):
if requirement.req.project_name in packages:
if not silent:
print 'Package {} found!'.format(requirement.req.project_name)
print('Package {} found!'.format(requirement.req.project_name))
exit(0)
if not silent:
print 'Not found.'.format(requirement.req.project_name)
print('Not found.'.format(requirement.req.project_name))
exit(1)