PEP 517 build frontends to inform users about wheel basename

Hey there! As PEP 517 and 518 are gaining more adoption, we are looking into ways of using them in Fedora RPM packaging.

Our packages build in sections, one section is responsible for unpacking the sources and applying patches (if any), another section builds the code (traditionally from source to a binary form), another section install the software to the buildroot, another sections is for running the tests etc.

Most importantly, we have the %build phase and we use to run python setup.py build in it, and we have the %install part, where we used to run python setup.py install --skip-build.

With PEP 517, we want to run pip wheel in %build and pip install the wheel in %install. The problem we have is that while the PEP 517 build_wheel hook returns the basename of the built wheel, pip AFAIK doesn’t share this information any further. We simply don’t know where the built wheel is located. I want to approach pip maintainers and ask them politely to print the information to stdout, so we can read it programmatically. In fact, I think this might be a good addition to the Recommendations for build frontends (non-normative).

Does a following addition makes sense?

A build frontend SHOULD make it possible to programmatically read the basename of built wheel when the build_wheel hook is invoked. For example, it might print the information to standard output.

Thanks for feedback.

1 Like

There’s a thread on pypa-dev on a similar use case. Maybe it’d be useful.

https://groups.google.com/forum/m/#!topic/pypa-dev/JIDMwuaoUCE

2 Likes

Thanks for that link. Eric explicitly asks for the name “without actually building the wheel first”. While I consider that useful as well, that would IMO require another (new) PEP 517 hook (or optional argument to the existing hook). While getting the name when the wheel is built is already part of the API, the information is just not propagated further by pip.

My feeling is that it’s an entirely reasonable feature request for pip, but I don’t think it’s something the PEP should cover. Generally, the PEP is about the interface between frontend and backend, not about the frontend’s UI.

I agree with @pf_moore, it seems like a reasonable feature request for pip, but not something that needs to be added to the PEP itself.

Thank y’all for the response. I filed this as https://github.com/pypa/pip/issues/6340.

1 Like