-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add remaining types to setuptools.build_meta #9890
Add remaining types to setuptools.build_meta #9890
Conversation
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This comment has been minimized.
This comment has been minimized.
|
Not a complete test of the API, but I was able to remove my type ignores and it's passing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! The stubs for the global functions can be simplified a bit, see my comment below.
For some of the parameters currently annotated with str
, they will strictly speaking also accept os.PathLike
objects, since the arguments are immediately passed to os.path.abspath
, which accepts path-like objects. But the fact that these parameters accept path-like objects now seems like an accident of the current implementation, rather than something that's designed to be supported. So let's stick with your current annotation of str
for those parameters.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
This is an attempt to finish the incomplete types in
setuptools.build_meta
. This is really useful if you are "wrapping" the PEP 715 interface to add something (like a dynamic dependency.Also adds the missing editable hooks (PEP 660), added in setuptools 62 IIRC.
Original source: https://github.com/pypa/setuptools/blob/main/setuptools/build_meta.py
Example of usage (currently full of type ignores): https://github.com/scikit-build/scikit-build-core/blob/main/src/scikit_build_core/setuptools/build_meta.py