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.
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/9189160606These 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 togrep --only-matching
to extract only the filepath like strings.GUS-W-15827366.