-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
prepare for pybind11-stubgen
#1804
Conversation
Adding the type aliases for from builtins import tuple as point3_t
from builtins import tuple as vector3_t this is technically correct but means that variables anotated as the following more precise definition should be added after the imports in the generated point3_t = tuple[float, float, float]
vector3_t = tuple[float, float, float] |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1804 +/- ##
=======================================
Coverage 95.67% 95.68%
=======================================
Files 123 123
Lines 9739 9754 +15
=======================================
+ Hits 9318 9333 +15
Misses 421 421 ☔ View full report in Codecov by Sentry. |
taken over in #1818 |
It seems like https://github.com/sizmailov/pybind11-stubgen is now mature enough to generate the
f3d
bindings stubs automatically.In order to properly generate the stubs we need to:
----ignore-unresolved-names
to ignoref3d::point3_t
andf3d::vector3_t
as we don't actually map them but let them auto-convert to and fromtuple[float, float, float]
--enum-class-locations SaveFormat:Image
to allow proper identification of the default value for theformat
parameters ofImage.save()
andImage.save_buffer()
With this PR's changes we can run the new
generate_stubs.py
script to generate the.pyi
files