-
-
Notifications
You must be signed in to change not 8000 ification settings - Fork 2.9k
stubgen throws AssertionError for QuantLib #19031
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
Comments
This sounds like a bug in stubgen to me. Which version of stubgen/mypy are you using? Also Cc @JelleZijlstra @AlexWaygood Could one of you move this to the mypy issue tracker? |
I can't because I'm only a mypy triager, not a maintainer. @sobolevn, @JelleZijlstra or @hauntsaninja can! |
done :) |
I currently have version 1.15.0 of stubgen installed. |
Okay, not so bad: it's only one variable that doesn't play by the rules. Namely the problematic object is That variable contains all C-layer global variables. It'd be great to extract its actual attributes, but I don't see a way to do so yet. At least we can add an exception and emit For anyone working on this, the reproducer is simply cd "$(mktemp -d)"
uv venv
. .venv/bin/activate
uv pip install mypy QuantLib
mkdir stubs
stubgen -o stubs/QuantLib -p QuantLib |
I'm also not that familiar with SWIG, but I found some documentation that calls We could also post an issue on the SWIG repo to ask for clarification on |
We should patch stubgen regardless, it shouldn't crash regardless of what weird things people do to objects. |
Hello, I am getting the error below when trying to create baseline stubs for the QuantLib package.
QuantLib's python bindings are generated using SWIG. Is this supported? I tried googling for any known limitations with SWIG but couldn't find any.
I'm very new to typeshed so apologies if I'm doing something silly.
The text was updated successfully, but these errors were encountered: