From d8b89fd888a48a2cf81bbb41f782f5a3f088488f Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 15 Aug 2024 14:20:03 +0100 Subject: [PATCH] typing: Annotate keystoneauth1.loading._utils Signed-off-by: Stephen Finucane Change-Id: I0de78bc9b30f6e1bbe055a2dc01f8d3608c45179 --- keystoneauth1/loading/_utils.py | 7 ++++++- setup.cfg | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/keystoneauth1/loading/_utils.py b/keystoneauth1/loading/_utils.py index 88e93bac..98326aaa 100644 --- a/keystoneauth1/loading/_utils.py +++ b/keystoneauth1/loading/_utils.py @@ -10,11 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. +import typing as ty + +if ty.TYPE_CHECKING: + from oslo_config import cfg as _cfg + cfg = None _NOT_FOUND = object() -def get_oslo_config(): +def get_oslo_config() -> '_cfg': """Runtime load the oslo.config object. In performance optimization of openstackclient it was determined that even diff --git a/setup.cfg b/setup.cfg index 73da2647..af76217d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -176,3 +176,6 @@ disallow_untyped_defs = true [mypy-keystoneauth1.loading.session] disallow_untyped_defs = true + +[mypy-keystoneauth1.loading._utils] +disallow_untyped_defs = true