-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
🎨📝 Fix in-tree PEP 517 backend wrapper example #3893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Before this patch, the documentation suggested the package authors to declare a fixed set of hooks inherited from setuptools. But this approach turned out non-future proof. Over time, as `setuptools` added support for editable installs, it introduced new hooks per PEP 660. But if one were to follow the outlined example, they'd end up with an in-tree build backend that does not support editable installs, nor would it re-export any hooks that might be added in future versions of setuptools, implementing any new standards that may emerge over time. This change demonstrates an approach that would allow the thin wrapper authors to get the new hooks that setuptools may add over time. Ref: ansible/ansible#79606 (comment)
Thank you very much @webknjaz. In #3897 I am trying to handle the CI problems identified here. What do you think about keeping both:
This way we can use |
I was planning a new release today so I went ahead and merged with the changes mentioned above. I hope that is OK. Thank you very much for the contribution. |
TIL about |
I'm conflicted about this. I think some linters may complain about the double import. Hence my original suggestion. Though, I personally prefer not shoving everything into a single module. Organizing things across many files as an importable package turned out to be more elegant, in my experience (I first used this approach like 3 years ago, and made use of it once or twice more over the years). @abravalheri do you think there a place for a more comprehensive example in the setuptools' docs? |
I believe that
Maybe, it is hard to tell before hand. More docs is usually a good thing (if the information they contain does not become outdated). There is always the possibility of writing an "advanced tutorial" and keeping in a separated section to avoid confusing beginners. |
Do you think it's better to put it into the PyPUG? |
Before this patch, the documentation suggested the package authors to declare a fixed set of hooks inherited from setuptools. But this approach turned out non-future proof. Over time, as
setuptools
added support for editable installs, it introduced new hooks per PEP 660. But if one were to follow the outlined example, they'd end up with an in-tree build backend that does not support editable installs, nor would it re-export any hooks that might be added in future versions of setuptools, implementing any new standards that may emerge over time.This change demonstrates an approach that would allow the thin wrapper authors to get the new hooks that setuptools may add over time.
Ref: ansible/ansible#79606 (comment)
Pull Request Checklist
changelog.d/
.(See documentation for details)