Skip to content

Commit 2143007

Browse files
authored
Python release prep (heroku#809)
* new recipe for new runtime * add new runtime formula * add test updates for new runtime release * wrangle tests into submission * update tests to use default_pythons * delete commented code
1 parent 20bbb3f commit 2143007

File tree

6 files changed

+32
-30
lines changed

6 files changed

+32
-30
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
test: test-heroku-18 test-heroku-16
55

66
check:
7-
@shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings
7+
@shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings bin/default_pythons
88
@shellcheck -x bin/steps/collectstatic bin/steps/eggpath-fix bin/steps/eggpath-fix2 bin/steps/gdal bin/steps/geo-libs bin/steps/mercurial bin/steps/nltk bin/steps/pip-install bin/steps/pip-uninstall bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/pylibmc bin/steps/python
99
@shellcheck -x bin/steps/hooks/*
1010

bin/compile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,9 @@ if [[ -n ${BUILDPACK_VENDOR_URL:-} ]]; then
4545
fi
4646
export VENDOR_URL
4747

48-
# Which versions of Python are we using?
49-
# These variables are used to specify which versions of Python to install by default,
50-
# as well as prompt the user to upgrade if they are using an un–supported version.
51-
# Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37.
52-
DEFAULT_PYTHON_VERSION="python-3.6.8"
53-
LATEST_36="python-3.6.8"
54-
LATEST_37="python-3.7.2"
55-
LATEST_35="python-3.5.6"
56-
LATEST_34="python-3.4.9"
57-
LATEST_27="python-2.7.15"
48+
# Default Python Versions
49+
# shellcheck source=bin/default_pythons
50+
source "$BIN_DIR/default_pythons"
5851

5952
# Supported Python Branches
6053
PY37="python-3.7"
@@ -68,8 +61,7 @@ DEFAULT_PYTHON_STACK="cedar-14"
6861
# If pip doesn't match this version (the version we install), run the installer.
6962
PIP_UPDATE="9.0.2"
7063

71-
export DEFAULT_PYTHON_VERSION DEFAULT_PYTHON_STACK PIP_UPDATE
72-
export LATEST_27 LATEST_36 LATEST_37 LATEST_35 LATEST_34
64+
export DEFAULT_PYTHON_STACK PIP_UPDATE
7365
export PY37 PY36 PY35 PY27 PY34
7466

7567
# Common Problem Warnings:

bin/default_pythons

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
DEFAULT_PYTHON_VERSION="python-3.6.8"
4+
LATEST_36="python-3.6.8"
5+
LATEST_37="python-3.7.2"
6+
LATEST_35="python-3.5.6"
7+
LATEST_34="python-3.4.9"
8+
LATEST_27="python-2.7.16"
9+
10+
export DEFAULT_PYTHON_VERSION LATEST_37 LATEST_36 LATEST_35 LATEST_34 LATEST_27

test/fixtures/python2/runtime.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-2.7.15
1+
python-2.7.16
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
python-2.7.14
1+
python-2.7.15

test/run

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env bash
22

3+
# Default Python Versions
4+
# shellcheck source=bin/default_pythons
5+
source "$BIN_DIR/default_pythons"
6+
37
testAirflow() {
48
export SLUGIFY_USES_TEXT_UNIDECODE="yes"
59
compile "airflow"
@@ -19,13 +23,13 @@ testPipenvLock() {
1923

2024
testPipenvVersion() {
2125
compile "pipenv-version"
22-
assertCaptured "3.6.8"
26+
assertCaptured $DEFAULT_PYTHON_VERSION
2327
assertCapturedSuccess
2428
}
2529

2630
testPipenvVersion2() {
2731
compile "pipenv-version2"
28-
assertCaptured "2.7.15"
32+
assertCaptured $LATEST_27
2933
assertCapturedSuccess
3034
}
3135
testPipenvFullVersion() {
@@ -95,25 +99,21 @@ testPylibmc() {
9599

96100
testPythonDefault() {
97101
compile "pythonDefault"
98-
assertCaptured "python-3.6.8"
102+
assertCaptured $DEFAULT_PYTHON_VERSION
99103
assertCapturedSuccess
100104
}
101105

102106
testPython2() {
103107
compile "python2"
104-
assertCaptured "python-2.7.15"
108+
assertCaptured $LATEST_27
105109
assertCapturedSuccess
106110
}
107111

108112
testPython2_warn() {
109113
compile "python2_warn"
110-
if [[ $STACK = "heroku-18" ]]; then
111-
assertCapturedError
112-
else
113-
assertCaptured "python-2.7.14"
114-
assertCaptured "security update!"
115-
assertCapturedSuccess
116-
fi
114+
assertCaptured "python-2.7.15"
115+
assertCaptured "security update!"
116+
assertCapturedSuccess
117117
}
118118

119119
testPython2_fail() {
@@ -124,7 +124,7 @@ testPython2_fail() {
124124

125125
testPython3_4() {
126126
compile "python3_4"
127-
assertCaptured "python-3.4.9"
127+
assertCaptured $LATEST_34
128128
assertCapturedSuccess
129129
}
130130

@@ -147,7 +147,7 @@ testPython3_4_fail() {
147147

148148
testPython3_5() {
149149
compile "python3_5"
150-
assertCaptured "python-3.5.6"
150+
assertCaptured $LATEST_35
151151
assertCapturedSuccess
152152
}
153153

@@ -170,7 +170,7 @@ testPython3_5_fail() {
170170

171171
testPython3_6() {
172172
compile "python3_6"
173-
assertCaptured "python-3.6.8"
173+
assertCaptured $LATEST_36
174174
assertCapturedSuccess
175175
}
176176

@@ -192,7 +192,7 @@ testPython3_7() {
192192
if [[ $STACK = "cedar-14" ]]; then
193193
assertCapturedError
194194
else
195-
assertCaptured "python-3.7.2"
195+
assertCaptured $LATEST_37
196196
assertCapturedSuccess
197197
fi
198198
}

0 commit comments

Comments
 (0)