Skip to content

Rename openssl-python to pyOpenSSL#5649

Merged
JelleZijlstra merged 2 commits into
python:masterfrom
srittau:openssl
Jun 16, 2021
Merged

Rename openssl-python to pyOpenSSL#5649
JelleZijlstra merged 2 commits into
python:masterfrom
srittau:openssl

Conversation

@srittau

@srittau srittau commented Jun 16, 2021

Copy link
Copy Markdown
Collaborator

Remove stubtest allowlist

Set package version

Closes: #5647

Remove stubtest allowlist

Set package version
@JelleZijlstra

Copy link
Copy Markdown
Member

Stubtest found a couple of legitimate issues.

@srittau

srittau commented Jun 16, 2021

Copy link
Copy Markdown
Collaborator Author

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

jolaf commented Jun 17, 2021

Copy link
Copy Markdown
Contributor

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

srittau commented Jun 17, 2021

Copy link
Copy Markdown
Collaborator Author

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

jolaf commented Jun 17, 2021

Copy link
Copy Markdown
Contributor

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