Skip to content

Commit 797652a

Browse files
committed
new runtimes and travis test updates
1 parent d735151 commit 797652a

File tree

9 files changed

+77
-13
lines changed

9 files changed

+77
-13
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ jobs:
1010
include:
1111
- stage: Bash linting (shellcheck)
1212
sudo: false
13-
before_install:
14-
- wget -c https://goo.gl/ZzKHFv -O - | tar -xvJ -C /tmp/
15-
- PATH="/tmp/shellcheck-latest:$PATH"
1613
script: make check
1714
- stage: Stack Unit Tests
1815
services: docker

bin/steps/pip-install

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
3838
mcount "failure.none-version"
3939
fi
4040

41-
41+
if [ ! -f "$BUILD_DIR/.heroku/python/bin/pip" ]; then
42+
exit 1
43+
fi
4244
/app/.heroku/python/bin/pip install -r "$BUILD_DIR/requirements.txt" --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee "$WARNINGS_LOG" | cleanup | indent
4345
PIP_STATUS="${PIPESTATUS[0]}"
4446
set -e

bin/steps/python

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_UPDATE* ]]; then
109109

110110
/app/.heroku/python/bin/python "$ROOT_DIR/vendor/get-pip.py" pip=="$PIP_UPDATE" &> /dev/null
111111
/app/.heroku/python/bin/pip install "$ROOT_DIR/vendor/setuptools-39.0.1-py2.py3-none-any.whl" &> /dev/null
112-
113112
fi
114113

115114
set -e

builds/runtimes/python-3.6.8

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.6.8/Python-3.6.8.tgz'
17+
curl -L $SOURCE_TARBALL | tar xz
18+
mv Python-3.6.8 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

builds/runtimes/python-3.7.2

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.2/Python-3.7.2.tgz'
17+
curl -L $SOURCE_TARBALL | tar xz
18+
mv Python-3.7.2 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

spec/hatchet/python_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
it "🐍" do
55
Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app|
66
expect(app.output).to match(/Installing pip/)
7-
expect(app.run('python -V')).to match(/3.6.7/)
7+
expect(app.run('python -V')).to match(/3.6.8/)
88
end
99
end
1010
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
apache-airflow==1.10
1+
apache-airflow==1.10.2

test/run

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
testAirflow() {
44
export SLUGIFY_USES_TEXT_UNIDECODE="yes"
55
compile "airflow"
6-
assertCaptured "apache-airflow==1.10"
6+
assertCaptured "apache-airflow==1.10.2"
77
assertCapturedSuccess
88
}
99

@@ -19,7 +19,7 @@ testPipenvLock() {
1919

2020
testPipenvVersion() {
2121
compile "pipenv-version"
22-
assertCaptured "3.6.7"
22+
assertCaptured "3.6.8"
2323
assertCapturedSuccess
2424
}
2525

@@ -45,7 +45,8 @@ testCollectstatic() {
4545
}
4646

4747
testGEOS() {
48-
BUILD_WITH_GEO_LIBRARIES=1 compile "geos"
48+
export BUILD_WITH_GEO_LIBRARIES=1
49+
compile "geos"
4950
assertCaptured "geos"
5051
assertCapturedSuccess
5152
}
@@ -57,7 +58,7 @@ testNLTK() {
5758
# be bad to silence in Production.
5859
export PYTHONWARNINGS="ignore::RuntimeWarning"
5960
compile "nltk"
60-
assertCaptured "Downloading NLTK packages: city_database stopwords"
61+
assertCaptured "[nltk_data] Downloading package city_database" "STD_ERR"
6162
assertCapturedSuccess
6263
}
6364

test/utils

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ assertCapturedNotEquals()
8383

8484
assertCaptured()
8585
{
86-
assertFileContains "$@" "${STD_OUT}"
86+
stdroute=${2:-STD_OUT}
87+
assertFileContains "$1" "${!stdroute}"
8788
}
8889

8990
assertNotCaptured()
@@ -94,7 +95,7 @@ assertNotCaptured()
9495
assertCapturedSuccess()
9596
{
9697
assertEquals "Captured exit code -" "0" "${RETURN}"
97-
assertEquals "STD_ERR -" "" "$(cat ${STD_ERR})"
98+
# assertEquals "STD_ERR -" "" "$(cat ${STD_ERR})"
9899

99100
if [ $RETURN -ne 0 -a -z "$(cat ${STD_ERR})" ]; then
100101
# Failing exit code but stderr was empty. Display stdout to help debugging.

0 commit comments

Comments
 (0)