heroku / heroku-buildpack-python

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

Add pre-upload Python runtime tests #1581

Closed edmorley closed 2 months ago

edmorley commented 2 months ago

We already test the Python runtimes via the buildpack's own tests (CNB example), however, these are run once the compiled Python runtime has already been uploaded to S3.

This adds tests as part of the compile/package/upload workflow itself.

In addition, these tests now also ensure that all of the optional stdlib modules have been built - since otherwise the upstream CPython configure scripts will happily skip modules where libraries/headers are missing, with only a small warning printed to the logs. These are similar to (but more comprehensive than): https://github.com/docker-library/official-images/blob/master/test/tests/python-imports/container.py

An example of the new tests showing an optional module hasn't been compiled: https://github.com/heroku/heroku-buildpack-python/actions/runs/9019650675/job/24782995243#step:6:1862

GUS-W-15727363.