heroku / heroku-buildpack-python

Heroku's buildpack for Python applications.
https://www.heroku.com/python
MIT License
974 stars 1.84k forks source link

Replace the `runtime-fixer` Python script with Bash #1568

Closed edmorley closed 5 months ago

edmorley commented 5 months ago

The legacy runtime-fixer script uses Python which is problematic since the script has to run prior to the buildpack actually installing Python.

As such:

There was unfortunately no explanation given as to why Python was chosen when the runtime-fixer script was first added: https://github.com/heroku/heroku-buildpack-python/commit/df52fd46e5b357503601d0f336c7fccb31b1f68b

(It probably didn't help that there were no stack change tests back then.)

Regardless, the only purpose of this script is to trim whitespace from the contents of runtime.txt, which we can easily do using Bash built-ins instead to avoid this issue.

The whitespace stripping already has a test, which still passes.

As an added bonus, removing the runtime-fixer script means we won't have to make it compatible with the python -> python3 switch for Heroku-24.

GUS-W-8059923.