Skip to content

Commit 53e33bd

Browse files
authored
Merge pull request heroku#814 from heroku/v-152
Python 3.7.3 release
2 parents 76bb572 + 5337dd5 commit 53e33bd

File tree

5 files changed

+67
-9
lines changed

5 files changed

+67
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Python Buildpack Changelog
22

3-
# 151 (2019-03-)
3+
# 152 (2019-04-04)
4+
5+
Python 3.7.3 now available.
6+
7+
# 151 (2019-03-21)
48

59
Python 3.5.7 and 3.4.10 now available on all Heroku stacks.
610

bin/default_pythons

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DEFAULT_PYTHON_VERSION="python-3.6.8"
44
LATEST_36="python-3.6.8"
5-
LATEST_37="python-3.7.2"
5+
LATEST_37="python-3.7.3"
66
LATEST_35="python-3.5.7"
77
LATEST_34="python-3.4.10"
88
LATEST_27="python-2.7.16"

builds/runtimes/python-3.7.3

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
# Build Path: /app/.heroku/python/
3+
4+
OUT_PREFIX=$1
5+
BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin"
6+
export BIN_DIR
7+
8+
# shellcheck source=bin/utils
9+
source "$BIN_DIR/steps/sqlite3"
10+
11+
sqlite3_version
12+
echo "Setting up SQLite3 Headers for $SQLITE3_VERSION"
13+
sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1
14+
15+
echo "Building Python…"
16+
SOURCE_TARBALL='https://python.org/ftp/python/3.7.3/Python-3.7.3.tgz'
17+
curl -L $SOURCE_TARBALL | tar xz
18+
mv Python-3.7.3 src
19+
cd src
20+
21+
./configure --prefix=$OUT_PREFIX --with-ensurepip=no
22+
make
23+
make install
24+
25+
# Remove unneeded test directories, similar to the official Docker Python images:
26+
# https://github.com/docker-library/python
27+
find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' +
28+
29+
# Remove spare /
30+
LOCATION=${OUT_PREFIX%?}
31+
32+
ln $LOCATION/bin/python3 $LOCATION/bin/python

test/run

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Default Python Versions
44
# shellcheck source=bin/default_pythons
5-
source "$BIN_DIR/default_pythons"
5+
source "bin/default_pythons"
66

77
testAirflow() {
88
export SLUGIFY_USES_TEXT_UNIDECODE="yes"
@@ -98,14 +98,19 @@ testPylibmc() {
9898
}
9999

100100
testPythonDefault() {
101+
updateVersion "pythonDefault" $DEFAULT_PYTHON_VERSION
101102
compile "pythonDefault"
102103
assertCaptured $DEFAULT_PYTHON_VERSION
104+
assertNotCaptured "security update"
103105
assertCapturedSuccess
104106
}
105107

106108
testPython2() {
109+
updateVersion "python2" $LATEST_27
110+
echo $LATEST_27 > "runtime.txt"
107111
compile "python2"
108112
assertCaptured $LATEST_27
113+
assertNotCaptured "security update"
109114
assertCapturedSuccess
110115
}
111116

@@ -123,9 +128,13 @@ testPython2_fail() {
123128
}
124129

125130
testPython3_4() {
126-
compile "python3_4"
127-
assertCaptured $LATEST_34
128-
assertCapturedSuccess
131+
if [[ $STACK != "cedar-14" ]]; then
132+
updateVersion "python3_4" $LATEST_34
133+
compile "python3_4"
134+
assertCaptured $LATEST_34
135+
assertNotCaptured "security update"
136+
assertCapturedSuccess
137+
fi
129138
}
130139

131140
testPython3_4_warn() {
@@ -146,9 +155,13 @@ testPython3_4_fail() {
146155
}
147156

148157
testPython3_5() {
149-
compile "python3_5"
150-
assertCaptured $LATEST_35
151-
assertCapturedSuccess
158+
if [[ $STACK != "cedar-14" ]]; then
159+
updateVersion "python3_5" $LATEST_35
160+
compile "python3_5"
161+
assertCaptured $LATEST_35
162+
assertNotCaptured "security update"
163+
assertCapturedSuccess
164+
fi
152165
}
153166

154167
testPython3_5_warn() {
@@ -169,8 +182,10 @@ testPython3_5_fail() {
169182
}
170183

171184
testPython3_6() {
185+
updateVersion "python3_6" $LATEST_36
172186
compile "python3_6"
173187
assertCaptured $LATEST_36
188+
assertNotCaptured "security update"
174189
assertCapturedSuccess
175190
}
176191

@@ -188,10 +203,12 @@ testPython3_6_fail() {
188203
}
189204

190205
testPython3_7() {
206+
updateVersion "python3_7" $LATEST_37
191207
compile "python3_7"
192208
if [[ $STACK = "cedar-14" ]]; then
193209
assertCapturedError
194210
else
211+
assertNotCaptured "security update"
195212
assertCaptured $LATEST_37
196213
assertCapturedSuccess
197214
fi

test/utils

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ release()
7171
capture ${BUILDPACK_HOME}/bin/release ${BUILD_DIR}
7272
}
7373

74+
updateVersion()
75+
{
76+
echo "$2" > "test/fixtures/${1}/runtime.txt"
77+
}
78+
7479
assertCapturedEquals()
7580
{
7681
assertEquals "$@" "$(cat ${STD_OUT})"

0 commit comments

Comments
 (0)