Skip to content
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

Rename openssl-python to pyOpenSSL #5649

Merged
merged 2 commits into from
Jun 16, 2021
Merged

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Jun 16, 2021

Remove stubtest allowlist

Set package version

Closes: #5647

Remove stubtest allowlist

Set package version
@JelleZijlstra
Copy link
Member

Stubtest found a couple of legitimate issues.

@srittau
Copy link
Collaborator Author

srittau commented Jun 16, 2021

I'd consider fixing the issues out of scope for this PR, so I have just added them to the allowlist, but maybe @jolaf wants to take a stab when this is merged?

@JelleZijlstra JelleZijlstra merged commit a98fcec into python:master Jun 16, 2021
@srittau srittau deleted the openssl branch June 16, 2021 15:27
@jolaf
Copy link
Contributor

jolaf commented Jun 17, 2021

I see python3 = true disappeared from METADATA.toml at rename.
Is it on purpose?

Is there a reason for still having some stub tests disabled?

@srittau
Copy link
Collaborator Author

srittau commented Jun 17, 2021

python3 = true is the default and we don't have it explicitly set for other stubs, so I removed it for consistency. The disabled tests fail, indicating that there might be a few problems left.

@jolaf
Copy link
Contributor

jolaf commented Jun 17, 2021

See #5657.

I've re-enabled the tests and fixed all problems but one:

error: OpenSSL.crypto is not a module
Stub: at line 1
MypyFile:1(
  /home/runner/work/typeshed/typeshed/stubs/pyOpenSSL/OpenSSL/crypto.pyi)
Runtime:
<cryptography.utils._ModuleWithDeprecations object at 0x7f0217cf0b80>

The root of the problem seems to be here:
https://github.com/python/mypy/blob/master/mypy/stubtest.py#L206

But I don't have any idea what would be a correct fix.

DMRobertson pushed a commit to matrix-org/synapse that referenced this pull request Oct 6, 2021
since at least here: python/typeshed#5649

Two fixups to keep mypy happy.

The first handles that `get_notAfter` could return None. Before this
would raise a generic `AttributeError`; now it raises a ValueError with
specific message.

The second ensures the callback to `set_verify` returns bool, not
NoneType. (AFAICS this was fine because PyOpenSSL only ever used the
truthiness of the callback's return value.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename openssl-python to pyOpenSSL
3 participants