Conversation
These hooks are implemented in Python to always return `[]` without calling into rust, we're leaving the hooks in rust for symmetry with the specs (PEP 517 and PEP 660).
In uv's case, `prepare_metadata_for_build_editable` is the same as `prepare_metadata_for_build_wheel`
1f31a91 to
6e7c8ec
Compare
BurntSushi
left a comment
There was a problem hiding this comment.
Some minor comments/nits, but LGTM!
| metadata_directory, | ||
| uv_version::version(), | ||
| )?; | ||
| println!("{filename}"); |
There was a problem hiding this comment.
println! has an unavoidable panic when writing to stdout fails. I would suggest writeln!(&mut std::io::stdout(), "{filename}")? here instead.
There was a problem hiding this comment.
Is it definitely intended for this function to just write to stdout? If so, I might put that in the docs for the function. It's hard to articulate why, but it does seem somewhat surprising. I think part of it is that I don't quite understand why filename is being written to stdout. Is that just part of PEP 660? (I'm not familiar with it.)
There was a problem hiding this comment.
It's the way in PEP 517 and PEP 660 how the build backend tells the frontend where to find the build artifact: It's in <wheel_directory>/<last line of stdout>.
I'm adding references to the spec name in the doc comment, otherwise I'm assuming familiarity with the spec (sorry - i don't expect you to read them and will of course answer questions for you). I tried to copy all relevant excerpts from the spec in earlier PEP implementations I did, but didn't found it to be effective.
| metadata_directory, | ||
| uv_version::version(), | ||
| )?; | ||
| println!("{filename}"); |

Support for editable installs. This is a simple PEP 660 implementation.