heroku / buildpacks-python

Heroku's Cloud Native Buildpack for Python applications.
BSD 3-Clause "New" or "Revised" License
27 stars 3 forks source link

Stop setting `PYTHONHOME` #265

Open edmorley opened 1 month ago

edmorley commented 1 month ago

In #25 we started setting PYTHONHOME to work around this bug in uWSGI: https://github.com/unbit/uwsgi/issues/2525

Now that we've switched from installing app dependencies into user site-packages to installing them into a venv (in #257), this workaround should no longer be necessary.

We should confirm this is the case, and if so, stop setting PYTHONHOME here: https://github.com/heroku/buildpacks-python/blob/53eabc7734f0027a62978eff61b95a51199a6895/src/layers/python.rs#L201-L214

However, we will also need to handle the case where an app is setting an invalid value for PYTHONHOME (which will be the case for very old Heroku apps, due to historic classic Python buildpack versions setting app level env vars via the bin/releases API). To do that we'll probably want to just error if such an env var is set, and tell users to unset it.