Compare commits

..

8 Commits

Author SHA1 Message Date
kennethreitz a7c20eea42 Python 3 default for buildpack (#409)
* update default python to 3.6.1

* v110

* nltk python2
2017-06-20 09:14:01 -07:00
kennethreitz 0a4cc2c476 pypy3-5.8.0 (#414) 2017-06-15 15:54:40 -04:00
Ed Morley cbb718bb8b Fix pip uninstall by moving it prior to pip install (#413)
The pip-uninstall step stopped working when it was moved to after
the pip-install step in f27a84e.

This regression was temporarily fixed by part of #397, however that
PR was reverted in #404.

Adds a test to hopefully catch any future regressions :-)

Fixes #393.
2017-06-14 17:15:52 -04:00
kennethreitz db95cdd3f3 new pylibmc test (#408) 2017-06-05 13:47:48 -04:00
kennethreitz 04f3ddbc86 updates (#407)
* silently use sp-grep

* history

* update license
2017-06-05 13:34:15 -04:00
kennethreitz f06f5676e8 silently use sp-grep (#406) 2017-06-05 13:31:57 -04:00
kennethreitz c8c8995d70 Next version (#405)
* python 3.5.3

* v108

* new setuptools version

* removed unneeded variable
2017-06-03 17:51:44 -04:00
kennethreitz 4ee3baaded Revert "Don't install packages that could mess packaging up" (#404)
* Revert "Fix pyyaml (#402)"

This reverts commit ff94908505.

* Revert "Don't install packages that could mess packaging up (#397)"

This reverts commit 5496c02f9f.
2017-06-03 17:36:19 -04:00
12 changed files with 75 additions and 75 deletions
+24 -6
View File
@@ -1,16 +1,34 @@
# Python Buildpack Changelog
# 110
Update Default Python to 3.6.1, bugfixes.
- Fixed automatic pip uninstall of dependencies removed from requirements.txt.
# 109
Fix output for collectstatic step.
# 108
Updated setuptools.
# 107
Bugfix for C dependency installation.
# 106
Don't install packages that could mess up packaging.
Don't install packages that could mess up packaging.
- The Python buildpack will automatically remove `six`, `pyparsing`, `appdirs`,
`setuptools`, and `distribute` from a `requirements.txt` file now, as these
packages are provided by the Python buildpack.
- The Python buildpack will automatically remove `six`, `pyparsing`, `appdirs`,
`setuptools`, and `distribute` from a `requirements.txt` file now, as these
packages are provided by the Python buildpack.
# 105
# 105
Improvements to output messaging.
Improvements to output messaging.
# 104
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License:
Copyright (C) 2016 Heroku, Inc.
Copyright (C) 2017 Heroku, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+1 -6
View File
@@ -32,11 +32,10 @@ CACHE_DIR=$2
ENV_DIR=$3
# Python defaults
DEFAULT_PYTHON_VERSION="python-2.7.13"
DEFAULT_PYTHON_VERSION="python-3.6.1"
DEFAULT_PYTHON_STACK="cedar-14"
PYTHON_EXE="/app/.heroku/python/bin/python"
PIP_VERSION="9.0.1"
SETUPTOOLS_VERSION="32.1.0"
# Common Problem Warnings
export WARNINGS_LOG=$(mktemp)
@@ -176,15 +175,11 @@ let start=$(nowms)
source $BIN_DIR/steps/pip-uninstall
mtime "pip.uninstall.time" "${start}"
# Cleanup requirements.txt
source $BIN_DIR/steps/setuptools
# 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.
let start=$(nowms)
sub-env $BIN_DIR/steps/nltk
+1 -1
View File
@@ -20,7 +20,7 @@ MANAGE_FILE=${MANAGE_FILE:-fakepath}
[ -f .heroku/collectstatic_disabled ] && DISABLE_COLLECTSTATIC=1
# Ensure that Django is explicitly specified in requirements.txt
sp-grep django && DJANGO_INSTALLED=1
sp-grep -s django && DJANGO_INSTALLED=1
if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALLED" ]; then
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/env bash
# Syntax sugar.
source $BIN_DIR/utils
puts-step "Removing packaging utilities from requirements.txt."
if [[ -f requirements.txt ]]; then
pip-clean requirements.txt
fi
+12
View File
@@ -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
+18
View File
@@ -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.5.3/Python-3.5.3.tgz'
curl -L $SOURCE_TARBALL | tar xz
mv Python-3.5.3 src
cd src
./configure --prefix=$OUT_PREFIX --with-ensurepip=no
make
make install
# ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
+1
View File
@@ -0,0 +1 @@
python-2.7.13
+1
View File
@@ -0,0 +1 @@
pylibmc
+16
View File
@@ -44,6 +44,12 @@ testPsycopg2() {
assertCapturedSuccess
}
testPylibmc() {
compile "pylibmc"
assertCaptured "pylibmc"
assertCapturedSuccess
}
testPython2() {
compile "python2"
assertCaptured "python-2.7.13"
@@ -56,6 +62,16 @@ testPython3() {
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
}
-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Usage:
pip-clean <req-file>
Options:
-h --help Show this screen.
"""
from docopt import docopt
BAD_PACKAGES = ['appdirs', 'packaging', 'pyparsing', 'six', 'setuptools', 'distribute']
def good_package(line):
package_name = line.split('=')[0].split('<')[0].split('>')[0].split(' ')[0].split('#')[0].split('\n')[0]
return package_name not in BAD_PACKAGES
def main():
args = docopt(__doc__, version='pip-clean')
req_file = args['<req-file>']
with open(req_file, 'r') as f:
# Iterate over every line in the requirements file.
lines = [line for line in f if good_package(line)]
# Write the requirements file to disk.
with open(req_file, 'w') as f:
f.write(''.join(lines))
if __name__ == '__main__':
main()
-17
View File
@@ -1,17 +0,0 @@
certifi==2017.4.17
chardet==3.0.3
dateparser
humanize==0.5.1
idna==2.5
maya==0.3.2
pendulum==1.2.1
python-dateutil==2.6.0
pytz==2017.2
pytzdata==2017.2
regex==2017.5.26
requests==2.17.3
ruamel.ordereddict==0.4.9
ruamel.yaml==0.14.12
tzlocal==1.4
urllib3==1.21.1