Commit 35b89386 authored by Kenneth Reitz's avatar Kenneth Reitz

Squashed commit of the following:

commit 1b6199c182a8cf453247ae2a19b7f1db71664dda
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 22:10:46 2017 -0800

    remove toml.py

commit e9215a30f111008b97ac50584a077b77585fda4a
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:58:59 2017 -0800

    fuck

commit d1f40a51aa01a7f2771cbac32543e9df021939a1
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:58:06 2017 -0800

    frost mirror

commit 0f1ec08f8fd88d9b7ebe5b17ad3cf75a7e2859dd
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:45:40 2017 -0800

    hmmmm

commit 9e2e857371029f3e9569a6cbfb71e5162a991339
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:44:30 2017 -0800

    hmmm

commit 892ba8bfcda54db993a10546970ccfe17c3fe51d
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:37:46 2017 -0800

    that

commit 61f80e7f5e380e8d6237adc1589a075f2974139b
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:36:41 2017 -0800

    this

commit 18a6f91ef5ff4410de43c562fffee99a0fb45da0
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:35:32 2017 -0800

    this

commit 163acc77e59cd34ec09a0d9836bbc20448e857ad
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:31:53 2017 -0800

    this

commit 4af63049cd1f6ced6daf1da43b15ef98ade84497
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 21:30:52 2017 -0800

    this

commit 43bde00a088a3a5b0db3d6361b24a679e5690e8e
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 14:59:04 2017 -0800

    olive garden

commit 24305ba1b2938f3d373d0c8d158c2137eb709c82
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Thu Mar 2 14:57:52 2017 -0800

    change

commit dff928b2299679ebdee08f4e82b8815b7cbbf419
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:55:22 2017 -0800

    hmmm

commit e3bc14ff9085c2a0e5939693bc71930c4e299f27
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:45:29 2017 -0800

    pipstrip

commit 8dd06e437bb8b519d434805aa923adfd20fb0086
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:37:43 2017 -0800

    changes

commit 3abaaa9b9fb9b3fdd3cbd9dc2ade25f282555a65
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:33:59 2017 -0800

    changes

commit 61aeea92418f934ac79e189cde69bcb9e74413fe
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:28:15 2017 -0800

    changes

commit 9219f38ac9f56c55e0030f55dbfdd5f55ae050de
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:27:37 2017 -0800

    changes

commit 390f40102b946a17f58697db42edc3d6d06f6581
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:26:31 2017 -0800

    changes

commit bdb0710e4554764f66a753c28f260af564ef6d6a
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:25:24 2017 -0800

    changes

commit 3af273e7ed56a5fdec6f5986f27b4ca5312861e1
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:24:15 2017 -0800

    changes

commit 250632c245bcba9bb331e6ad7b6d1afd5ddc34c5
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:23:06 2017 -0800

    changes

commit 5c9a637a75aaf20087e80114607cc15f00b39ff3
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:16:47 2017 -0800

    toml.py

commit f672922a7bc09e9d7a2c559bb6be1e718703c459
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:15:26 2017 -0800

    vendor dir

commit 67d44200454510c3a625257909f7e708778359ec
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:14:45 2017 -0800

    change

commit 12dc70d7d91ce57944e221591cf3bf3bef0e0a0c
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:12:57 2017 -0800

    changes

commit 25673345579e8f1d7394b9ba60682f97be63273b
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:12:28 2017 -0800

    this

commit a4a5a6d006197158a511677d3aae25183531ff3e
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:07:19 2017 -0800

    changes

commit 49c2c9ab901aaa4cd9c8c168f5b388b032708e51
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:05:03 2017 -0800

    changes

commit 2d3223d95968408889d79f722df7628b9e4533c8
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:04:24 2017 -0800

    changes

commit 6334b0f62afcbb3bc91bb706d30e6dd9aadfe447
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 19:02:35 2017 -0800

    detect python version

commit df606fa0aeed0754e659cce41fa28a88c471c756
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:56:08 2017 -0800

    hide stderr

commit 7ac261f62ee6c38e709a1560baadc181494b97db
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:53:37 2017 -0800

    update

commit f8530d252c2b386fb9f65a991d94380d3eccfdfd
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:51:46 2017 -0800

    lock

commit 7a1e10034a591890aa16c6e34ba5cb3d6b90a7b7
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:50:53 2017 -0800

    just generate requriements file

commit d78630ff858394cbae8397e1d060a3cc2437943f
Merge: 766b0c6 66f5a667
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:49:04 2017 -0800

    Merge branch 'master' into pipenv

commit 766b0c66e742790dc45df73e021302cf18601947
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:47:42 2017 -0800

    semicolon wrong

commit a9017bce79a4075ed1682041ca19c54092be71bb
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:41:54 2017 -0800

    run pipenv

commit 651c3aa90e45aa9f7509b127e4a21110907974cf
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:41:45 2017 -0800

    detect on pipfile

commit 6d9f553e24b82e756dd4c02063da035025144c9b
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:41:37 2017 -0800

    pipenv step

commit 51c6ef3060ac707bcb0361ccbbcfca50035a4360
Author: Kenneth Reitz <me@kennethreitz.org>
Date:   Wed Mar 1 18:41:26 2017 -0800

    new vendors
parent 66f5a667
......@@ -42,7 +42,7 @@ export WARNINGS_LOG=$(mktemp)
export RECOMMENDED_PYTHON_VERSION=$DEFAULT_PYTHON_VERSION
# 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"
export BPWATCH_STORE_PATH=$CACHE_DIR/bpwatch.json
BUILDPACK_VERSION=v28
......@@ -107,12 +107,6 @@ bpwatch start pre_compile
source $BIN_DIR/steps/hooks/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.
if [ -f $CACHE_DIR/.heroku/python-version ]; then
DEFAULT_PYTHON_VERSION=$(cat $CACHE_DIR/.heroku/python-version)
......@@ -125,6 +119,9 @@ else
CACHED_PYTHON_STACK=$STACK
fi
# Pipenv Python version support.
source $BIN_DIR/steps/pipenv-python-version
# If no runtime given, assume default version.
if [ ! -f runtime.txt ]; then
echo $DEFAULT_PYTHON_VERSION > runtime.txt
......@@ -172,6 +169,14 @@ source $BIN_DIR/steps/python
# Sanity check for setuptools/distribute.
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.
source $BIN_DIR/steps/pip-uninstall
......
......@@ -15,7 +15,7 @@
BUILD_DIR=$1
# 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
fi
......
# 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
# 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
File added
#!/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))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment