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

Pass mypy #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion jaraco/crypto/cert.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from __future__ import annotations

import ctypes
from typing import ClassVar

from .support import find_library

Expand Down Expand Up @@ -50,7 +53,7 @@ class BIO(ctypes.Structure):


class X509(ctypes.Structure):
_fields_ = [] # type: ignore
_fields_: ClassVar[list[tuple[str, type[ctypes._CData]]]] = []

def get_serial_number(self):
asn1_i = lib.X509_get_serialNumber(ctypes.byref(self))
Expand Down
24 changes: 12 additions & 12 deletions jaraco/crypto/cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def finalize(self, data=None):
return b"".join(self.out_data)


evp.get_cipherbyname.argtypes = (ctypes.c_char_p,) # type: ignore
evp.get_cipherbyname.restype = ctypes.POINTER(CipherType) # type: ignore
evp.get_cipherbyname.argtypes = (ctypes.c_char_p,)
evp.get_cipherbyname.restype = ctypes.POINTER(CipherType)


# https://www.openssl.org/docs/man3.1/man3/EVP_CipherInit_ex.html
Expand All @@ -130,16 +130,16 @@ def finalize(self, data=None):
ctypes.c_char_p, # out[m]
ctypes.POINTER(ctypes.c_int), # outl
)
evp.EncryptInit_ex.argtypes = ( # type: ignore
evp.DecryptInit_ex.argtypes # type: ignore
) = _init_args[:2] + _init_args[3:5]
evp.CipherInit_ex.argtypes = _init_args # type: ignore
evp.EncryptUpdate.argtypes = ( # type: ignore
evp.DecryptUpdate.argtypes # type: ignore
) = evp.CipherUpdate.argtypes = _update_args # type: ignore
evp.EncryptFinal_ex.argtypes = ( # type: ignore
evp.DecryptFinal_ex.argtypes # type: ignore
) = evp.CipherFinal_ex.argtypes = _final_args # type: ignore
evp.EncryptInit_ex.argtypes = evp.DecryptInit_ex.argtypes = (
_init_args[:2] + _init_args[3:5]
)
evp.CipherInit_ex.argtypes = _init_args
evp.EncryptUpdate.argtypes = evp.DecryptUpdate.argtypes = evp.CipherUpdate.argtypes = (
_update_args
)
evp.EncryptFinal_ex.argtypes = evp.DecryptFinal_ex.argtypes = (
evp.CipherFinal_ex.argtypes
) = _final_args

evp.lib.EVP_CIPHER_CTX_new.argtypes = None
evp.lib.EVP_CIPHER_CTX_new.restype = ctypes.POINTER(Cipher)
Expand Down
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ explicit_package_bases = True
disable_error_code =
# Disable due to many false positives
overload-overlap,
# This package has too many dynamically assigned attributes
attr-defined,
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,3 @@ namespaces = true


[tool.setuptools_scm]


[tool.pytest-enabler.mypy]
# Disabled due to jaraco/skeleton#143
Loading