Uh oh!
There was an error while loading. Please reload this page.
[weasyprint] Add stubs for WeasyPrint 69.0 - #15349
Conversation
This comment has been minimized.
This comment has been minimized.
srittau
commented
Feb 2, 2026
Yes, that's perfectly fine. |
TuringTux
commented
Feb 2, 2026
Thanks for the quick reply! Then I will see to it that at least my use case is completely mapped (and the checks run green, I suppose), and would then change this PR to ready. |
TuringTux
commented
Mar 23, 2026
Well, I haven't forgotten about this, and funnily enough, today the organisation behind WeasyPrint sort of doubled down on the fact they don't like type hints: https://www.courtbouillon.org/blog/00064-types/ Meaning this PR could become very relevant if I ever get the time to implement something, which I still hope I do soon-ish. |
liZe
commented
Apr 13, 2026
Hi! WeasyPrint has a pretty stable, official public API. All the other functions are not supposed to be used by WeasyPrint users, and regularly break between versions. I don’t know what the best solution is in this case, but I think that adding type hints only for this public API is probably easier and better. |
TuringTux
commented
Apr 14, 2026
That would also be sufficient for me. The current state of this PR is auto-generated, by the tool provided in the Typeshed repo. Does that mean I could remove a lot of the current files, and only include those corresponding to the Python files containing the public API? |
liZe
commented
Apr 14, 2026
I think so. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
srittau
commented
Jul 13, 2026
A hint to maybe help this get over the finish line: I've just opened #16011 to add some guidance about missing dependencies. For your convenience, I've copied it here: When a third-party stub package depends on another package, there are several
|
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
srittau
commented
Jul 13, 2026
Correct, you don't need the partial-stub setting. |
srittau
commented
Jul 13, 2026
The rest of the mypy failures look very manageable. I would just suppress the untyped decorator warnings for now (using |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
TuringTux
commented
Jul 13, 2026
I might have reduced it to three error messages: This seems to be some problem with a |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
TuringTux
commented
Jul 14, 2026
Looks like I still got the decorators wrong, sadly. I will look closer into this, because it would be nice if they just worked. |
This adds a really small set of annotations for WeasyPrint 69.0.
I use WeasyPrint in one of my projects, use only a few methods, but would like to have my type checker working for these.
Is it okay if a submit this to typeshed, even though it will be only partially annotated?