-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Workaround to stubtest to handle pyOpenSSL correctly #10663
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
… cryptography.utils._ModuleWithDeprecations
This seems quite fragile. Personally I would just ignore it in typeshed. In general, stubtest isn't meant to work perfectly in every possible situation, which is why the exclude lists exist. |
I agree with @Akuli, I don't think we should add this kind of module-specific logic. |
Well, I understand that, but after I've made this fix, |
This will become unnecessary in the future when module-level |
That future is here as of Python 3.7, for what it's worth. |
But pyopenssl still supports Python 2 (eww) and 3.6. https://github.com/pyca/pyopenssl/blob/main/setup.py |
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, the improvements to pyOpenSSL have been great!
Like others here, I'm wary of special casing for specific packages in stubtest. I'd be potentially okay with it if it were a common idiom, but I don't think that's the case. value
is a very common attribute name and this could cause some confusing things to happen.
I see this would not be merged, but just in case, I've provided a more explicit check excluding any vagueness. |
…s not going to be merged. See python/mypy#10663.
Description
Currently,
stubtest
fails onpyOpenSSL
stubs becausepyOpenSSL
has its submodules wrapped intocryptography.utils._ModuleWithDeprecations
instances and some of the methods wrapped intocryptography.utils._DeprecatedValue
instances.See python/typeshed#5657 (comment) for details.
This PR adds additional checks to
runtime
field that allows unwrapping_ModuleWithDeprecations
and_DeprecatedValue
objects and extracting module and function objects from them.Test Plan
After this PR is applied, tests for python/typeshed#5657 should pass without errors.