Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-python
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-python
Commits
6a12d139
Commit
6a12d139
authored
May 14, 2018
by
Liu Junxiao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master'
parents
8247866e
af7332b5
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
227 additions
and
68 deletions
+227
-68
.travis.yml
.travis.yml
+9
-9
CHANGELOG.md
CHANGELOG.md
+8
-0
README.md
README.md
+3
-3
compile
bin/compile
+131
-36
collectstatic
bin/steps/collectstatic
+6
-8
pip-install
bin/steps/pip-install
+1
-4
pip-uninstall
bin/steps/pip-uninstall
+1
-1
pylibmc
bin/steps/pylibmc
+1
-1
python
bin/steps/python
+1
-1
buildpack.toml
buildpack.toml
+13
-0
python-2.7.15
builds/runtimes/python-2.7.15
+19
-0
python-3.6.5
builds/runtimes/python-3.6.5
+21
-0
requirements.txt
test/fixtures/git-egg/requirements.txt
+1
-0
runtime.txt
test/fixtures/python2/runtime.txt
+1
-1
run
test/run
+9
-3
pipenv-to-pip
vendor/pipenv-to-pip
+2
-1
No files found.
.travis.yml
View file @
6a12d139
...
@@ -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
...
...
CHANGELOG.md
View file @
6a12d139
# 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.
...
...
README.md
View file @
6a12d139
...
@@ -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.1
4
"
python_full_version = "2.7.1
5
"
Or, with a
`runtime.txt`
file:
Or, with a
`runtime.txt`
file:
$ cat runtime.txt
$ cat runtime.txt
python-2.7.1
4
python-2.7.1
5
Runtime options include:
Runtime options include:
-
`python-3.6.4`
-
`python-3.6.4`
-
`python-2.7.1
4
`
-
`python-2.7.1
5
`
Customization in China Mainland
Customization in China Mainland
...
...
bin/compile
View file @
6a12d139
This diff is collapsed.
Click to expand it.
bin/steps/collectstatic
View file @
6a12d139
...
@@ -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
el
if
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
el
if
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
el
if
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
...
...
bin/steps/pip-install
View file @
6a12d139
...
@@ -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
...
...
bin/steps/pip-uninstall
View file @
6a12d139
...
@@ -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
...
...
bin/steps/pylibmc
View file @
6a12d139
...
@@ -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
...
...
bin/steps/python
View file @
6a12d139
...
@@ -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.toml
0 → 100644
View file @
6a12d139
[buildpack]
name
=
"Python"
[publish.Ignore]
files
=
[
"test/"
,
".gitignore"
,
".dockerignore"
,
".github/"
,
"Dockerfile"
,
"Pipfile"
,
"Pipfile.lock"
]
\ No newline at end of file
builds/runtimes/python-2.7.15
0 → 100755
View file @
6a12d139
#!/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
'{}'
+
builds/runtimes/python-3.6.5
0 → 100755
View file @
6a12d139
#!/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
test/fixtures/git-egg/requirements.txt
0 → 100644
View file @
6a12d139
-e git+https://github.com/requests/requests.git#egg=requests
\ No newline at end of file
test/fixtures/python2/runtime.txt
View file @
6a12d139
python-2.7.14
python-2.7.15
\ No newline at end of file
test/run
View file @
6a12d139
...
@@ -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.1
4
"
assertCaptured
"python-2.7.1
5
"
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
}
}
...
...
vendor/pipenv-to-pip
View file @
6a12d139
#!/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
=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment