Communicate PEP 517 hook results via files #2314
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In #1813, we were failing to install
scikit-image==0.19.3
from source in Python 3.11. Confusingly, though, the trace showed that the build command exited with status 0...The issue is that we get results from the PEP 517 hooks by reading from
stdout
-- that is, weprint
at the end of the script, and parse the printed output on the other side.It turns out that for
scikit-image
, in this case, there was output after the wheel filename:We need the
scikit_image-0.19.3-cp311-cp311-macosx_14_0_arm64.whl
line, but we were failing to find it due to all the extra output at the end (presumedly, some kind ofatexit
logging).This PR modifies the hooks to instead write their results to files that are passed in by the parent. On the other end, we then read the results back from disk. This makes it much more robust to "other" output in the script.
Closes #1813.
Test Plan
Ran
cargo run pip install scikit-image==0.19.3 --reinstall --no-cache-dir
on Python 3.11.