mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 15:00:19 +00:00
ce684e4539
The `BUILD_WITH_GEO_LIBRARIES` feature was removed in the previous PR, and replaced with a warning that the feature is no longer supported. After further thought I believe it would be best to make this warning fatal, to prevent unexpected failures at runtime, if consumers of the library either aren't invoked during the build, or were previously installed/cached and were dynamically linked against the library. Continuation of #1113 / @W-7654424@.
68 lines
2.4 KiB
Bash
Executable File
68 lines
2.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
shopt -s extglob
|
|
|
|
old-platform() {
|
|
if grep -qi 'InsecurePlatformWarning' "$WARNINGS_LOG"; then
|
|
echo
|
|
puts-warn "Hello! It looks like your application is using an outdated version of Python."
|
|
puts-warn "This caused the security warning you saw above during the 'pip install' step."
|
|
puts-warn "We recommend '$RECOMMENDED_PYTHON_VERSION', which you can specify in a 'runtime.txt' file."
|
|
puts-warn " -- Much Love, Heroku."
|
|
mcount 'warnings.python.old'
|
|
fi
|
|
}
|
|
|
|
scipy-included() {
|
|
if grep -qi 'running setup.py install for scipy' "$WARNINGS_LOG"; then
|
|
echo
|
|
puts-warn "Hello! It looks like you're trying to use scipy on Heroku."
|
|
puts-warn "Unfortunately, at this time, we do not directly support this library."
|
|
puts-warn "There is, however, a buildpack available that makes it possible to use it on Heroku."
|
|
puts-warn "You can learn more here: https://devcenter.heroku.com/articles/python-c-deps"
|
|
puts-warn "Sorry for the inconvenience. -- Much Love, Heroku."
|
|
mcount 'warnings.scipy'
|
|
fi
|
|
}
|
|
|
|
distribute-included() {
|
|
if grep -qi 'Running setup.py install for distribute' "$WARNINGS_LOG"; then
|
|
echo
|
|
puts-warn "Hello! Your requirements.txt file contains the distribute package."
|
|
puts-warn "This library is automatically installed by Heroku and shouldn't be in"
|
|
puts-warn "Your requirements.txt file. This can cause unexpected behavior."
|
|
puts-warn " -- Much Love, Heroku."
|
|
mcount 'warnings.distribute'
|
|
fi
|
|
}
|
|
|
|
six-included() {
|
|
if grep -qi 'Running setup.py install for six' "$WARNINGS_LOG"; then
|
|
echo
|
|
puts-warn "Hello! Your requirements.txt file contains the six package."
|
|
puts-warn "This library is automatically installed by Heroku and shouldn't be in"
|
|
puts-warn "Your requirements.txt file. This can cause unexpected behavior."
|
|
puts-warn " -- Much Love, Heroku."
|
|
mcount 'warnings.six'
|
|
fi
|
|
}
|
|
|
|
gdal-missing() {
|
|
if grep -qi 'Could not find gdal-config' "$WARNINGS_LOG"; then
|
|
mcount 'warnings.gdal'
|
|
echo
|
|
puts-warn "Hello! Package installation failed since the GDAL library was not found."
|
|
puts-warn "For GDAL, GEOS and PROJ support, use the Geo buildpack alongside the Python buildpack:"
|
|
puts-warn "https://github.com/heroku/heroku-geo-buildpack"
|
|
puts-warn " -- Much Love, Heroku."
|
|
fi
|
|
}
|
|
|
|
show-warnings() {
|
|
old-platform
|
|
scipy-included
|
|
distribute-included
|
|
six-included
|
|
gdal-missing
|
|
}
|
|
|