mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 19:22:16 +02:00
Use latest version of mypy (#8992)
Fixes #8899 This PR removes the pinning upper limit of mypy currently set to <0.900 and adds the required types-* stub packages to make recent versions of mypy work. * Unpin mypy * Improve type in TempHandler * Add types
This commit is contained in:
@@ -232,10 +232,15 @@ def generate_csr(domains, key_path, csr_path, key_type=RSA_KEY_TYPE):
|
||||
with warnings.catch_warnings():
|
||||
# Ignore a warning on some old versions of cryptography
|
||||
warnings.simplefilter('ignore', category=PendingDeprecationWarning)
|
||||
key = ec.generate_private_key(ec.SECP384R1(), default_backend())
|
||||
key = key.private_bytes(encoding=Encoding.PEM, format=PrivateFormat.TraditionalOpenSSL,
|
||||
encryption_algorithm=NoEncryption())
|
||||
key = crypto.load_privatekey(crypto.FILETYPE_PEM, key)
|
||||
_key = ec.generate_private_key(ec.SECP384R1(), default_backend())
|
||||
# This type ignore directive is required due to an outdated version of types-cryptography.
|
||||
# It can be removed once package types-pyOpenSSL depends on cryptography instead of
|
||||
# types-cryptography and so types-cryptography is not installed anymore.
|
||||
# See https://github.com/python/typeshed/issues/5618
|
||||
_bytes = _key.private_bytes(encoding=Encoding.PEM, # type: ignore
|
||||
format=PrivateFormat.TraditionalOpenSSL,
|
||||
encryption_algorithm=NoEncryption())
|
||||
key = crypto.load_privatekey(crypto.FILETYPE_PEM, _bytes)
|
||||
else:
|
||||
raise ValueError('Invalid key type: {0}'.format(key_type))
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,4 @@
|
||||
from distutils.version import LooseVersion
|
||||
import sys
|
||||
|
||||
from setuptools import __version__ as setuptools_version
|
||||
from setuptools import find_packages
|
||||
@@ -30,6 +29,7 @@ install_requires = [
|
||||
'pywin32>=300 ; sys_platform == "win32"',
|
||||
'pyyaml',
|
||||
'requests',
|
||||
'types-python-dateutil'
|
||||
]
|
||||
|
||||
setup(
|
||||
|
||||
Reference in New Issue
Block a user