mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8a75c56d0 | |||
| 27ce818f3d | |||
| f582b2f4fa | |||
| c46a779ea1 | |||
| 06a7d9e187 | |||
| ca773cf957 | |||
| 26b54b690c | |||
| 871d5b5935 | |||
| 0382c31225 | |||
| 4a856ff5b3 | |||
| e247704dfb | |||
| c8b031fafc | |||
| 68b740cce6 | |||
| e856e787aa | |||
| 7e4159e297 | |||
| d9a73b847e | |||
| 3dbeec8db1 | |||
| 8ec0b5f0dd | |||
| 3c2839147f | |||
| a51c162444 | |||
| 14096e0ca5 | |||
| 2631f5204b | |||
| f3b1e54df4 | |||
| 536b10b249 | |||
| b22aa3b3a7 | |||
| eb395a94f9 | |||
| b2597c45d8 | |||
| 1525c1fb3a | |||
| fd17f5a470 | |||
| ac923205d0 | |||
| 6617a3cac5 | |||
| 64a4f51e1b | |||
| 6305ed415a | |||
| 3dff0d48fe | |||
| 6f94b366f8 | |||
| 6bb89e6693 | |||
| 6252e80aa6 | |||
| b22ef82b4f | |||
| 129bced2dd | |||
| c82415733d | |||
| ee93719b79 | |||
| 361eb53257 | |||
| bf9fe3badf | |||
| 9178962b84 | |||
| 2b4a68c8c8 | |||
| f38eec962f | |||
| a313e66d93 | |||
| c755286323 | |||
| 0d219f5d2e | |||
| 28bdeb6f4b | |||
| 496a1ad7d8 | |||
| 57dec77718 | |||
| 4dc60cb4ca | |||
| f5f67653f8 | |||
| b7fd5915a5 | |||
| 72f7c510b9 | |||
| ac62aa01d5 | |||
| a727daa6ff | |||
| 2187855da2 | |||
| fb1ed99470 | |||
| be68853991 | |||
| c9d794dc76 | |||
| c1cc0910c5 | |||
| 61095f726d | |||
| 721d062421 | |||
| f38c90b1d5 | |||
| 8c0284dbe8 | |||
| f8f4facdca | |||
| e97f13395f | |||
| dc87fca814 | |||
| aafd7caf77 | |||
| ef964bfc1a | |||
| e5ae885ae1 | |||
| 2291255133 | |||
| d48294f940 | |||
| ef87cce5a9 | |||
| 63048e641d | |||
| 91aa427137 | |||
| 811c1ceeb6 | |||
| 8c2e95fb46 | |||
| d47fb9f718 | |||
| 4625eca277 | |||
| b2abb41a38 | |||
| b228d36041 | |||
| 7680aea223 | |||
| 771042a619 | |||
| b1f7713916 | |||
| 7b0c04b95b | |||
| 9f09c934bf | |||
| 88bad450fd | |||
| 7614f77431 | |||
| 761f27958a | |||
| 52347a0c98 | |||
| e2e97b774a | |||
| 4f0f97959f | |||
| 93f4eeb227 | |||
| ec769e00bb | |||
| ade975d48f | |||
| 16a07abd51 | |||
| 2bc071b323 | |||
| 3c07ec133e | |||
| 5c74244695 | |||
| 4e877e4f11 | |||
| 51ec7e3741 | |||
| 1f983fea40 | |||
| a26f0374ec | |||
| a0029a8411 | |||
| 2de3b6cf1c |
@@ -40,12 +40,13 @@ Specify a Runtime
|
|||||||
You can also provide arbitrary releases Python with a `runtime.txt` file.
|
You can also provide arbitrary releases Python with a `runtime.txt` file.
|
||||||
|
|
||||||
$ cat runtime.txt
|
$ cat runtime.txt
|
||||||
python-3.4.1
|
python-3.4.2
|
||||||
|
|
||||||
Runtime options include:
|
Runtime options include:
|
||||||
|
|
||||||
- python-2.7.8
|
- python-2.7.8
|
||||||
- python-3.4.1
|
- python-3.4.2
|
||||||
- pypy-1.9 (experimental)
|
- pypy-2.4.0 (unsupported, experimental)
|
||||||
|
- pypy3-2.4.0 (unsupported, experimental)
|
||||||
|
|
||||||
Other [unsupported runtimes](https://github.com/heroku/heroku-buildpack-python/tree/master/builds/runtimes) are available as well.
|
Other [unsupported runtimes](https://github.com/heroku/heroku-buildpack-python/tree/master/builds/runtimes) are available as well.
|
||||||
|
|||||||
+11
-4
@@ -24,12 +24,13 @@ CACHED_DIRS=".heroku"
|
|||||||
VIRTUALENV_LOC=".heroku/venv"
|
VIRTUALENV_LOC=".heroku/venv"
|
||||||
LEGACY_TRIGGER="lib/python2.7"
|
LEGACY_TRIGGER="lib/python2.7"
|
||||||
PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh"
|
PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh"
|
||||||
|
WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh"
|
||||||
|
|
||||||
DEFAULT_PYTHON_VERSION="python-2.7.8"
|
DEFAULT_PYTHON_VERSION="python-2.7.9"
|
||||||
DEFAULT_PYTHON_STACK="cedar"
|
DEFAULT_PYTHON_STACK="cedar"
|
||||||
PYTHON_EXE="/app/.heroku/python/bin/python"
|
PYTHON_EXE="/app/.heroku/python/bin/python"
|
||||||
PIP_VERSION="1.5.6"
|
PIP_VERSION="6.0.6"
|
||||||
SETUPTOOLS_VERSION="5.4.1"
|
SETUPTOOLS_VERSION="11.3.1"
|
||||||
|
|
||||||
# Setup bpwatch
|
# Setup bpwatch
|
||||||
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
export PATH=$PATH:$ROOT_DIR/vendor/bpwatch
|
||||||
@@ -150,6 +151,9 @@ mkdir -p $(dirname $PROFILE_PATH)
|
|||||||
# Install Python.
|
# Install Python.
|
||||||
source $BIN_DIR/steps/python
|
source $BIN_DIR/steps/python
|
||||||
|
|
||||||
|
# Sanity check for setuptools/distribute.
|
||||||
|
source $BIN_DIR/steps/setuptools
|
||||||
|
|
||||||
# Uninstall removed dependencies with Pip.
|
# Uninstall removed dependencies with Pip.
|
||||||
source $BIN_DIR/steps/pip-uninstall
|
source $BIN_DIR/steps/pip-uninstall
|
||||||
|
|
||||||
@@ -163,7 +167,7 @@ source $BIN_DIR/steps/pylibmc
|
|||||||
source $BIN_DIR/steps/cryptography
|
source $BIN_DIR/steps/cryptography
|
||||||
|
|
||||||
# Install dependencies with Pip.
|
# Install dependencies with Pip.
|
||||||
source $BIN_DIR/steps/pip-install
|
sub-env $BIN_DIR/steps/pip-install
|
||||||
|
|
||||||
# Django collectstatic support.
|
# Django collectstatic support.
|
||||||
sub-env $BIN_DIR/steps/collectstatic
|
sub-env $BIN_DIR/steps/collectstatic
|
||||||
@@ -182,6 +186,9 @@ set-default-env LANG en_US.UTF-8
|
|||||||
set-default-env PYTHONHASHSEED random
|
set-default-env PYTHONHASHSEED random
|
||||||
set-default-env PYTHONPATH /app/
|
set-default-env PYTHONPATH /app/
|
||||||
|
|
||||||
|
# Install sane-default script for WEB_CONCURRENCY environment variable.
|
||||||
|
cp $ROOT_DIR/vendor/python.webconcurrency.sh $WEBCONCURRENCY_PROFILE_PATH
|
||||||
|
|
||||||
|
|
||||||
# Experimental post_compile hook.
|
# Experimental post_compile hook.
|
||||||
bpwatch start post_compile
|
bpwatch start post_compile
|
||||||
|
|||||||
@@ -19,10 +19,8 @@ source $BIN_DIR/utils
|
|||||||
|
|
||||||
bpwatch start libffi_install
|
bpwatch start libffi_install
|
||||||
|
|
||||||
whereis pkg-config
|
|
||||||
|
|
||||||
# If pylibmc exists within requirements, use vendored cryptography.
|
# If pylibmc exists within requirements, use vendored cryptography.
|
||||||
if (pip-grep -s requirements.txt cffi pylibmc) then
|
if (pip-grep -s requirements.txt bcrypt cffi cryptography &> /dev/null) then
|
||||||
|
|
||||||
if [ -d ".heroku/vendor/lib/libffi-3.1.1" ]; then
|
if [ -d ".heroku/vendor/lib/libffi-3.1.1" ]; then
|
||||||
export LIBFFI=$(pwd)/vendor
|
export LIBFFI=$(pwd)/vendor
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source $BIN_DIR/utils
|
||||||
|
|
||||||
# Install dependencies with Pip.
|
# Install dependencies with Pip.
|
||||||
puts-step "Installing dependencies with pip"
|
puts-step "Installing dependencies with pip"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ source $BIN_DIR/utils
|
|||||||
bpwatch start pylibmc_install
|
bpwatch start pylibmc_install
|
||||||
|
|
||||||
# If pylibmc exists within requirements, use vendored libmemcached.
|
# 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 ".heroku/vendor/lib/sasl2" ]; then
|
if [ -d ".heroku/vendor/lib/sasl2" ]; then
|
||||||
export LIBMEMCACHED=$(pwd)/vendor
|
export LIBMEMCACHED=$(pwd)/vendor
|
||||||
|
|||||||
+8
-8
@@ -16,7 +16,7 @@ fi
|
|||||||
if [ ! $STACK = $CACHED_PYTHON_STACK ]; then
|
if [ ! $STACK = $CACHED_PYTHON_STACK ]; then
|
||||||
bpwatch start uninstall_python
|
bpwatch start uninstall_python
|
||||||
puts-step "Stack changed, re-installing runtime"
|
puts-step "Stack changed, re-installing runtime"
|
||||||
rm -fr .heroku/python
|
rm -fr .heroku/python .heroku/python-stack .heroku/vendor
|
||||||
unset SKIP_INSTALL
|
unset SKIP_INSTALL
|
||||||
bpwatch stop uninstall_python
|
bpwatch stop uninstall_python
|
||||||
fi
|
fi
|
||||||
@@ -52,22 +52,22 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then
|
|||||||
|
|
||||||
bpwatch start prepare_environment
|
bpwatch start prepare_environment
|
||||||
|
|
||||||
|
TMPTARDIR=$(mktemp -d)
|
||||||
|
trap "rm -rf $TMPTARDIR" RETURN
|
||||||
|
|
||||||
bpwatch start install_setuptools
|
bpwatch start install_setuptools
|
||||||
# Prepare it for the real world
|
# Prepare it for the real world
|
||||||
# puts-step "Installing Setuptools ($SETUPTOOLS_VERSION)"
|
# puts-step "Installing Setuptools ($SETUPTOOLS_VERSION)"
|
||||||
cd $ROOT_DIR/vendor/
|
tar zxf $ROOT_DIR/vendor/setuptools-$SETUPTOOLS_VERSION.tar.gz -C $TMPTARDIR
|
||||||
tar zxf setuptools-$SETUPTOOLS_VERSION.tar.gz
|
cd $TMPTARDIR/setuptools-$SETUPTOOLS_VERSION/
|
||||||
cd $ROOT_DIR/vendor/setuptools-$SETUPTOOLS_VERSION/
|
|
||||||
python setup.py install &> /dev/null
|
python setup.py install &> /dev/null
|
||||||
cd $WORKING_DIR
|
cd $WORKING_DIR
|
||||||
bpwatch stop install_setuptoools
|
bpwatch stop install_setuptoools
|
||||||
|
|
||||||
bpwatch start install_pip
|
bpwatch start install_pip
|
||||||
# puts-step "Installing Pip ($PIP_VERSION)"
|
# puts-step "Installing Pip ($PIP_VERSION)"
|
||||||
|
tar zxf $ROOT_DIR/vendor/pip-$PIP_VERSION.tar.gz -C $TMPTARDIR
|
||||||
cd $ROOT_DIR/vendor/
|
cd $TMPTARDIR/pip-$PIP_VERSION/
|
||||||
tar zxf pip-$PIP_VERSION.tar.gz
|
|
||||||
cd $ROOT_DIR/vendor/pip-$PIP_VERSION/
|
|
||||||
python setup.py install &> /dev/null
|
python setup.py install &> /dev/null
|
||||||
cd $WORKING_DIR
|
cd $WORKING_DIR
|
||||||
|
|
||||||
|
|||||||
Executable
+11
@@ -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
|
||||||
Executable
+23
@@ -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 ..
|
||||||
Vendored
+1
-1
@@ -10,7 +10,7 @@ hash -r
|
|||||||
|
|
||||||
echo "Building libffi..."
|
echo "Building libffi..."
|
||||||
|
|
||||||
SOURCE_TARBALL='http://cl.ly/2s1t1u3v0N0I/download/libffi-3.1.tar'
|
SOURCE_TARBALL='ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz'
|
||||||
|
|
||||||
curl -L $SOURCE_TARBALL | tar x
|
curl -L $SOURCE_TARBALL | tar x
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-1
@@ -22,7 +22,8 @@ curl -LO ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz
|
|||||||
tar xzf cyrus-sasl-2.1.26.tar.gz
|
tar xzf cyrus-sasl-2.1.26.tar.gz
|
||||||
|
|
||||||
pushd cyrus-sasl-2.1.26
|
pushd cyrus-sasl-2.1.26
|
||||||
./configure --prefix=${OUT_PREFIX}
|
./configure --prefix=${OUT_PREFIX} --with-plugindir=${OUT_PREFIX}lib/sasl2 --with-configdir=${OUT_PREFIX}lib/sasl2
|
||||||
|
|
||||||
make -s -j 9
|
make -s -j 9
|
||||||
make install -s
|
make install -s
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Build Path: /app/.heroku/python/
|
# 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.
|
# NOTICE: This formula only works for the cedar-14 stack, not cedar.
|
||||||
|
|
||||||
|
|||||||
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.4.0-linux64.tar.bz2'
|
||||||
|
curl -L $SOURCE_TARBALL | tar jx
|
||||||
|
cp -R pypy-2.4.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/pypy3-2.4.0-linux64.tar.bz2'
|
||||||
|
curl -L $SOURCE_TARBALL | tar jx
|
||||||
|
cp -R pypy3-2.4.0-linux64/* $OUT_PREFIX
|
||||||
|
|
||||||
|
ln $OUT_PREFIX/bin/pypy3 $OUT_PREFIX/bin/python
|
||||||
@@ -10,6 +10,6 @@ curl -L $SOURCE_TARBALL | tar xz
|
|||||||
mv Python-2.7.8 src
|
mv Python-2.7.8 src
|
||||||
cd src
|
cd src
|
||||||
|
|
||||||
./configure --prefix=$OUT_PREFIX
|
./configure --prefix=$OUT_PREFIX --enable-shared
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build Path: /app/.heroku/python/
|
||||||
|
# Build Deps: libraries/sqlite
|
||||||
|
|
||||||
|
OUT_PREFIX=$1
|
||||||
|
|
||||||
|
echo "Building Python..."
|
||||||
|
SOURCE_TARBALL='http://python.org/ftp/python/2.7.9/Python-2.7.9.tgz'
|
||||||
|
curl -L $SOURCE_TARBALL | tar xz
|
||||||
|
mv Python-2.7.9 src
|
||||||
|
cd src
|
||||||
|
|
||||||
|
./configure --prefix=$OUT_PREFIX --with-ensurepip=no
|
||||||
|
make
|
||||||
|
make install
|
||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Build Path: /app/.heroku/python/
|
||||||
|
# Build Deps: libraries/sqlite
|
||||||
|
|
||||||
|
OUT_PREFIX=$1
|
||||||
|
|
||||||
|
echo "Building Python..."
|
||||||
|
SOURCE_TARBALL='http://python.org/ftp/python/3.3.6/Python-3.3.6.tgz'
|
||||||
|
curl -L $SOURCE_TARBALL | tar xz
|
||||||
|
mv Python-3.3.6 src
|
||||||
|
cd src
|
||||||
|
|
||||||
|
./configure --prefix=$OUT_PREFIX --enable-shared
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
ln $OUT_PREFIX/bin/python3 $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='http://python.org/ftp/python/3.4.2/Python-3.4.2.tgz'
|
||||||
|
curl -L $SOURCE_TARBALL | tar xz
|
||||||
|
mv Python-3.4.2 src
|
||||||
|
cd src
|
||||||
|
|
||||||
|
./configure --prefix=$OUT_PREFIX --with-ensurepip=no --enable-shared
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
|
||||||
|
|
||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
+9
-4
@@ -13,6 +13,10 @@ Options:
|
|||||||
import os
|
import os
|
||||||
from docopt import docopt
|
from docopt import docopt
|
||||||
from pip.req import parse_requirements
|
from pip.req import parse_requirements
|
||||||
|
from pip.index import PackageFinder
|
||||||
|
from pip._vendor.requests import session
|
||||||
|
|
||||||
|
requests = session()
|
||||||
|
|
||||||
class Requirements(object):
|
class Requirements(object):
|
||||||
def __init__(self, reqfile=None):
|
def __init__(self, reqfile=None):
|
||||||
@@ -31,7 +35,8 @@ class Requirements(object):
|
|||||||
if not os.path.exists(reqfile):
|
if not os.path.exists(reqfile):
|
||||||
raise ValueError('The given requirements file does not exist.')
|
raise ValueError('The given requirements file does not exist.')
|
||||||
|
|
||||||
for requirement in parse_requirements(reqfile):
|
finder = PackageFinder([], [], session=requests)
|
||||||
|
for requirement in parse_requirements(reqfile, finder=finder, session=requests):
|
||||||
if requirement.req:
|
if requirement.req:
|
||||||
self.requirements.append(requirement.req)
|
self.requirements.append(requirement.req)
|
||||||
|
|
||||||
@@ -79,18 +84,18 @@ def diff(r1, r2, include_fresh=False, include_stale=False):
|
|||||||
r1 = Requirements(r1)
|
r1 = Requirements(r1)
|
||||||
r2 = Requirements(r2)
|
r2 = Requirements(r2)
|
||||||
except ValueError:
|
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)
|
exit(os.EX_NOINPUT)
|
||||||
|
|
||||||
results = r1.diff(r2, ignore_versions=True)
|
results = r1.diff(r2, ignore_versions=True)
|
||||||
|
|
||||||
if include_fresh:
|
if include_fresh:
|
||||||
for line in results['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:
|
if include_stale:
|
||||||
for line in results['stale']:
|
for line in results['stale']:
|
||||||
print line.project_name if include_versions else line
|
print(line.project_name if include_versions else line)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+9
-4
@@ -10,6 +10,10 @@ Options:
|
|||||||
import os
|
import os
|
||||||
from docopt import docopt
|
from docopt import docopt
|
||||||
from pip.req import parse_requirements
|
from pip.req import parse_requirements
|
||||||
|
from pip.index import PackageFinder
|
||||||
|
from pip._vendor.requests import session
|
||||||
|
|
||||||
|
requests = session()
|
||||||
|
|
||||||
class Requirements(object):
|
class Requirements(object):
|
||||||
def __init__(self, reqfile=None):
|
def __init__(self, reqfile=None):
|
||||||
@@ -28,7 +32,8 @@ class Requirements(object):
|
|||||||
if not os.path.exists(reqfile):
|
if not os.path.exists(reqfile):
|
||||||
raise ValueError('The given requirements file does not exist.')
|
raise ValueError('The given requirements file does not exist.')
|
||||||
|
|
||||||
for requirement in parse_requirements(reqfile):
|
finder = PackageFinder([], [], session=requests)
|
||||||
|
for requirement in parse_requirements(reqfile, finder=finder, session=requests):
|
||||||
self.requirements.append(requirement)
|
self.requirements.append(requirement)
|
||||||
|
|
||||||
|
|
||||||
@@ -41,7 +46,7 @@ def grep(reqfile, packages, silent=False):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
||||||
if not silent:
|
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)
|
exit(os.EX_NOINPUT)
|
||||||
|
|
||||||
@@ -52,12 +57,12 @@ def grep(reqfile, packages, silent=False):
|
|||||||
if requirement.req.project_name in packages:
|
if requirement.req.project_name in packages:
|
||||||
|
|
||||||
if not silent:
|
if not silent:
|
||||||
print 'Package {} found!'.format(requirement.req.project_name)
|
print('Package {} found!'.format(requirement.req.project_name))
|
||||||
|
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
if not silent:
|
if not silent:
|
||||||
print 'Not found.'.format(requirement.req.project_name)
|
print('Not found.'.format(requirement.req.project_name))
|
||||||
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
case $(ulimit -u) in
|
||||||
|
|
||||||
|
# 1X DYNO
|
||||||
|
256)
|
||||||
|
export DYNO_RAM=512
|
||||||
|
export WEB_CONCURRENCY=${WEB_CONCURRENCY:-2}
|
||||||
|
;;
|
||||||
|
|
||||||
|
# 2X DYNO
|
||||||
|
512)
|
||||||
|
export DYNO_RAM=1024
|
||||||
|
export WEB_CONCURRENCY=${WEB_CONCURRENCY:-4}
|
||||||
|
;;
|
||||||
|
|
||||||
|
# PX DYNO
|
||||||
|
32768)
|
||||||
|
export DYNO_RAM=8192
|
||||||
|
export WEB_CONCURRENCY=${WEB_CONCURRENCY:-9}
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user