heroku / heroku-buildpack-python

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

Fix editable mode tests after latest setuptools release #1586

Closed edmorley closed 2 months ago

edmorley commented 2 months ago

This fixes the editable mode tests that are currently failing on main after the most recent setuptools release: https://github.com/heroku/heroku-buildpack-python/actions/runs/9189160606

These tests have to test packaging implementation details since the buildpack has to perform path rewriting to work around Python being relocated between build and run time (thankfully the CNB doesn't have to do this). The test fixtures also intentionally don't pin the setuptools version used as the package build backend, since most project.toml-using projects in the wild don't do so, and we want to ensure compatibility with the latest setuptools version. Both of these factors mean these tests are prone to churn.

However, I've managed to rewrite the tests to still test the implementation details we care about (the rewritten paths) but make them less susceptible to breakage due to changes format of the finder .py files - by switching to grep --only-matching to extract only the filepath like strings.

GUS-W-15827366.