From 8f58f5b7b9ca92c3a7e18e81d975a0c8f9e99b6e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 21 Oct 2024 12:54:15 +0100 Subject: [PATCH] typing: Set remaining 'disallow_*' opts to 'true' We need two ignores due to incomplete type hints for requests, but this is otherwise a straightforward swap. Signed-off-by: Stephen Finucane Change-Id: I0b0d2d50fa3b70184785a6d146902dafab561654 --- keystoneauth1/extras/_saml2/v3/saml2.py | 2 +- keystoneauth1/session.py | 2 +- setup.cfg | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/keystoneauth1/extras/_saml2/v3/saml2.py b/keystoneauth1/extras/_saml2/v3/saml2.py index b336645a..62d8754f 100644 --- a/keystoneauth1/extras/_saml2/v3/saml2.py +++ b/keystoneauth1/extras/_saml2/v3/saml2.py @@ -143,7 +143,7 @@ class _SamlAuth(requests.auth.AuthBase): request.headers['Accept'] = ','.join([accept, _PAOS_HEADER]) request.headers['PAOS'] = _PAOS_VER - request.register_hook('response', self._handle_response) + request.register_hook('response', self._handle_response) # type: ignore[no-untyped-call] return request def _handle_response( diff --git a/keystoneauth1/session.py b/keystoneauth1/session.py index 570239ca..fc1e77c4 100644 --- a/keystoneauth1/session.py +++ b/keystoneauth1/session.py @@ -1689,4 +1689,4 @@ class TCPKeepAliveAdapter(requests.adapters.HTTPAdapter): # hands for no longer than 2 minutes before a ConnectionError is # raised. kwargs['socket_options'] = socket_options - super().init_poolmanager(*args, **kwargs) + super().init_poolmanager(*args, **kwargs) # type: ignore[no-untyped-call] diff --git a/setup.cfg b/setup.cfg index baa6cafd..f29f87fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -85,9 +85,8 @@ strict_equality = true strict_concatenate = true disallow_untyped_decorators = true disallow_any_generics = true -# the following are false while we incrementally add typing -disallow_subclassing_any = false -disallow_untyped_calls = false +disallow_subclassing_any = true +disallow_untyped_calls = true disallow_incomplete_defs = true disallow_untyped_defs = true no_implicit_reexport = true @@ -103,7 +102,11 @@ exclude = (?x)( ignore_errors = true [mypy-keystoneauth1.hacking.*] +disallow_subclassing_any = false disallow_untyped_defs = false +disallow_untyped_calls = false [mypy-keystoneauth1.fixture.*] +disallow_subclassing_any = false disallow_untyped_defs = false +disallow_untyped_calls = false