Commit 6a12d139 authored by Liu Junxiao's avatar Liu Junxiao

Merge remote-tracking branch 'upstream/master'

parents 8247866e af7332b5
...@@ -2,15 +2,15 @@ language: bash ...@@ -2,15 +2,15 @@ language: bash
dist: trusty dist: trusty
jobs: jobs:
include: include:
- stage: "Bash linting (shellcheck)" # - stage: "Bash linting (shellcheck)"
sudo: false # sudo: false
addons: # addons:
apt: # apt:
sources: # sources:
- debian-sid # Grab shellcheck from the Debian repo (o_O) # - debian-sid # Grab shellcheck from the Debian repo (o_O)
packages: # packages:
- shellcheck # - shellcheck
script: make check # script: make check
- stage: "Stack Tests" - stage: "Stack Tests"
services: docker services: docker
......
# Python Buildpack Changelog # Python Buildpack Changelog
# 134
Default to 3.6.5, bugfixes.
# 133
Fixes for Pip 10 release.
# 132 # 132
Improve pip installation, with the release of v9.0.2. Improve pip installation, with the release of v9.0.2.
......
...@@ -49,17 +49,17 @@ Specific versions of the Python runtime can be specified in your `Pipfile`: ...@@ -49,17 +49,17 @@ Specific versions of the Python runtime can be specified in your `Pipfile`:
Or, more specifically: Or, more specifically:
[requires] [requires]
python_full_version = "2.7.14" python_full_version = "2.7.15"
Or, with a `runtime.txt` file: Or, with a `runtime.txt` file:
$ cat runtime.txt $ cat runtime.txt
python-2.7.14 python-2.7.15
Runtime options include: Runtime options include:
- `python-3.6.4` - `python-3.6.4`
- `python-2.7.14` - `python-2.7.15`
Customization in China Mainland Customization in China Mainland
......
This diff is collapsed.
...@@ -44,22 +44,20 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALL ...@@ -44,22 +44,20 @@ if [ ! "$DISABLE_COLLECTSTATIC" ] && [ -f "$MANAGE_FILE" ] && [ "$DJANGO_INSTALL
# Display a warning if collectstatic failed. # Display a warning if collectstatic failed.
[ "$COLLECTSTATIC_STATUS" -ne 0 ] && { [ "$COLLECTSTATIC_STATUS" -ne 0 ] && {
mcount "failure.collectstatic"
if grep -q 'SyntaxError' "$COLLECTSTATIC_LOG"; then if grep -q 'SyntaxError' "$COLLECTSTATIC_LOG"; then
mcount "failure.collectstatic.syntax-error" mcount "failure.collectstatic.syntax-error"
fi
if grep -q 'ImproperlyConfigured' "$COLLECTSTATIC_LOG"; then elif grep -q 'ImproperlyConfigured' "$COLLECTSTATIC_LOG"; then
mcount "failure.collectstatic.improper-configuration" mcount "failure.collectstatic.improper-configuration"
fi
if grep -q 'The CSS file' "$COLLECTSTATIC_LOG"; then elif grep -q 'The CSS file' "$COLLECTSTATIC_LOG"; then
mcount "failure.collectstatic.fancy-references" mcount "failure.collectstatic.fancy-references"
fi
if grep -q 'OSError' "$COLLECTSTATIC_LOG"; then elif grep -q 'OSError' "$COLLECTSTATIC_LOG"; then
mcount "failure.collectstatic.missing-file" mcount "failure.collectstatic.missing-file"
else
mcount "failure.collectstatic.other"
fi fi
echo echo
......
...@@ -20,9 +20,6 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then ...@@ -20,9 +20,6 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
mcount "tool.pip" mcount "tool.pip"
# Count expected build failures. # Count expected build failures.
if grep -q 'wsgiref' requirements.txt; then
mcount "failure.wsgiref"
fi
if grep -q '==0.0.0' requirements.txt; then if grep -q '==0.0.0' requirements.txt; then
mcount "failure.none-version" mcount "failure.none-version"
fi fi
...@@ -35,10 +32,10 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then ...@@ -35,10 +32,10 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
show-warnings show-warnings
if [[ ! $PIP_STATUS -eq 0 ]]; then if [[ ! $PIP_STATUS -eq 0 ]]; then
mcount "failure.pip-install"
exit 1 exit 1
fi fi
# Smart Requirements handling # Smart Requirements handling
cp requirements.txt .heroku/python/requirements-declared.txt cp requirements.txt .heroku/python/requirements-declared.txt
/app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
......
...@@ -20,7 +20,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then ...@@ -20,7 +20,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
if [[ -s .heroku/python/requirements-stale.txt ]]; then if [[ -s .heroku/python/requirements-stale.txt ]]; then
puts-step "Uninstalling stale dependencies" puts-step "Uninstalling stale dependencies"
/app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w | cleanup | indent /app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w --disable-pip-version-check | cleanup | indent
fi fi
fi fi
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# This script is invoked by [`bin/compile`](/). # This script is invoked by [`bin/compile`](/).
if [[ "$STACK" == "heroku-16" ]]; then if [[ "$STACK" != "cedar-14" ]]; then
# libmemcached is pre-installed in the stack image so there is no need to vendor it. # libmemcached is pre-installed in the stack image so there is no need to vendor it.
return 0 return 0
fi fi
......
...@@ -69,7 +69,7 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then ...@@ -69,7 +69,7 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then
rm -fr /app/.heroku/python/lib/python*/site-packages/pip-* rm -fr /app/.heroku/python/lib/python*/site-packages/pip-*
rm -fr /app/.heroku/python/lib/python*/site-packages/setuptools-* rm -fr /app/.heroku/python/lib/python*/site-packages/setuptools-*
/app/.heroku/python/bin/python "$ROOT_DIR/vendor/get-pip.py" &> /dev/null /app/.heroku/python/bin/python "$ROOT_DIR/vendor/get-pip.py" pip=="$PIP_UPDATE" &> /dev/null
/app/.heroku/python/bin/pip install "$ROOT_DIR/vendor/setuptools-39.0.1-py2.py3-none-any.whl" &> /dev/null /app/.heroku/python/bin/pip install "$ROOT_DIR/vendor/setuptools-39.0.1-py2.py3-none-any.whl" &> /dev/null
fi fi
......
[buildpack]
name = "Python"
[publish.Ignore]
files = [
"test/",
".gitignore",
".dockerignore",
".github/",
"Dockerfile",
"Pipfile",
"Pipfile.lock"
]
\ No newline at end of file
#!/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/2.7.15/Python-2.7.15.tgz'
curl -L $SOURCE_TARBALL | tar xz
mv Python-2.7.15 src
cd src
./configure --prefix=$OUT_PREFIX --enable-unicode=ucs4 --with-ensurepip=no
make
make install
# Remove unneeded test directories, similar to the official Docker Python images:
# https://github.com/docker-library/python
find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' +
#!/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.6.5/Python-3.6.5.tgz'
curl -L $SOURCE_TARBALL | tar xz
mv Python-3.6.5 src
cd src
./configure --prefix=$OUT_PREFIX --with-ensurepip=no
make
make install
# Remove unneeded test directories, similar to the official Docker Python images:
# https://github.com/docker-library/python
find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' +
ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python
-e git+https://github.com/requests/requests.git#egg=requests
\ No newline at end of file
python-2.7.14 python-2.7.15
\ No newline at end of file
...@@ -12,7 +12,7 @@ testPipenvLock() { ...@@ -12,7 +12,7 @@ testPipenvLock() {
testPipenvVersion() { testPipenvVersion() {
compile "pipenv-version" compile "pipenv-version"
assertCaptured "3.6.4" assertCaptured "3.6.5"
assertCapturedSuccess assertCapturedSuccess
} }
...@@ -77,13 +77,19 @@ testPylibmc() { ...@@ -77,13 +77,19 @@ testPylibmc() {
testPython2() { testPython2() {
compile "python2" compile "python2"
assertCaptured "python-2.7.14" assertCaptured "python-2.7.15"
assertCapturedSuccess assertCapturedSuccess
} }
testPython3() { testPython3() {
compile "python3" compile "python3"
assertCaptured "python-3.6.4" assertCaptured "python-3.6.5"
assertCapturedSuccess
}
testGitEgg() {
compile "git-egg"
assertCaptured "requests"
assertCapturedSuccess assertCapturedSuccess
} }
......
#!/usr/bin/env python #!/usr/bin/env python
import io
import json import json
import sys import sys
...@@ -7,7 +8,7 @@ import sys ...@@ -7,7 +8,7 @@ import sys
def main(): def main():
INFILE = sys.argv[1] INFILE = sys.argv[1]
with open(INFILE, 'rb') as f: with io.open(INFILE, 'r', encoding='utf-8') as f:
lockfile = json.load(f) lockfile = json.load(f)
packages = [] packages = []
......
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