-
Notifications
You must be signed in to change notification settings - Fork 41
typing: Update GStreamer with typed overrides #243
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
|
I started adding some typing for the easy parts: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/10238. This PR is an update of stubs with that GStreamer PR applied. pre-commit fails all overrides with |
031e1c2 to
14a4c21
Compare
|
Why are class attributes now after the init? |
|
@lovetox That's a side effect of c04550f.
That solve an issue with at least |
|
Do you think you can put them again in front? |
|
@lovetox ok, managed to preserve ordering. |
|
Thanks looks better now.
If typing extensions is indeed necessary, then we would need to add it as dependency in pyproject.toml EDIT: Found where |
done. More generally, overrides could import any extra modules, maybe at some point we'll need a more generic way. |
aee4398 to
bae9adb
Compare
|
Could you rebase your commits on current master, the enum fix is already in master. I want to test your generator changes against the other libs and if it does not introduce unwanted changes, we can merge. |
|
@lovetox done |
|
I tested and found no regression with Gtk and GLib, which are probably the most used stubs. Can you please prefix commits with the prefixes described in CONTRIBUTING.md, otherwise they will not properly included in the automatic generated changelog. |
This requires python 3.14 to run the generator. When using older Python, simply remove quotes and double-quotes.
This removes all local overrides because GStreamer upstream now has typed override APIs.
When overrides defines for example: ``` class FooError(Exception): pass ``` _get_gname() was returning None for both FooError and Exception classes, which means it was not excluding methods from Exception base class.
This fix typing of overrides that provide more pythonic syntax for iterators, context manager, etc.
Overrides could define new classes, such as:
class FooError(Exception):
pass
It is required for __enter__ annotation.
|
@lovetox done |
|
Thanks for the improvments to the generator ! |
No description provided.