Skip to content

Commit 29013e1

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "typing: Require typed defs"
2 parents 135672b + a29e27d commit 29013e1

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

openstackclient/identity/v3/identity_provider.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
LOG = logging.getLogger(__name__)
3232

3333

34-
def _format_identity_provider(idp):
34+
def _format_identity_provider(
35+
idp: Any,
36+
) -> tuple[tuple[str, ...], tuple[Any, ...]]:
3537
columns = (
3638
'authorization_ttl',
3739
'description',

openstackclient/identity/v3/mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
LOG = logging.getLogger(__name__)
3333

3434

35-
def _format_mapping(mapping):
35+
def _format_mapping(mapping: Any) -> tuple[tuple[str, ...], tuple[Any, ...]]:
3636
columns = ('id', 'rules', 'schema_version')
3737
column_headers = ('id', 'rules', 'schema_version')
3838
return (

openstackclient/image/v2/metadef_namespaces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def take_action(
358358
class UnsetMetadefNamespace(command.Command):
359359
_description = _("Unset metadef namespace tags")
360360

361-
def get_parser(self, prog_name):
361+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
362362
parser = super().get_parser(prog_name)
363363
parser.add_argument(
364364
"namespace",
@@ -385,7 +385,7 @@ def get_parser(self, prog_name):
385385
)
386386
return parser
387387

388-
def take_action(self, parsed_args):
388+
def take_action(self, parsed_args: argparse.Namespace) -> None:
389389
image_client = self.app.client_manager.image
390390

391391
namespace = image_client.get_metadef_namespace(parsed_args.namespace)

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,14 @@ ignore_missing_imports = true
786786
follow_imports = "normal"
787787
incremental = true
788788
check_untyped_defs = true
789+
disallow_untyped_defs = true
789790
warn_unused_ignores = true
790791
exclude = "(?x)(doc | examples | hacking | releasenotes)"
791792

793+
[[tool.mypy.overrides]]
794+
module = ["openstackclient.tests.functional.*"]
795+
disallow_untyped_defs = false
796+
792797
[[tool.mypy.overrides]]
793798
module = ["openstackclient.tests.unit.*"]
794799
ignore_errors = true

0 commit comments

Comments
 (0)