From a86d0490cadfc2f9fe5490879a1258cf264d5202 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 24 Nov 2021 21:15:45 -0800 Subject: [PATCH 1/2] chore: enable subset of the 'mypy --strict' options that work Enable the subset of the 'mypy --strict' options that work with no changes to the code. --- pyproject.toml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3e8116904..8e9920ec3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,25 @@ multi_line_output = 3 order_by_type = false [tool.mypy] +files = "." + +# 'strict = true' is equivalent to the following: +check_untyped_defs = true disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true disallow_untyped_defs = true -files = "." +warn_unused_configs = true +warn_unused_ignores = true + +# The following need to have changes made to be able to enable them: +# disallow_any_generics = true +# disallow_untyped_calls = true +# no_implicit_optional = true +# no_implicit_reexport = true +# strict_equality = true +# warn_redundant_casts = true +# warn_return_any = true [[tool.mypy.overrides]] # Overrides for currently untyped modules module = [ From f40e9b3517607c95f2ce2735e3b08ffde8d61e5a Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 24 Nov 2021 21:24:16 -0800 Subject: [PATCH 2/2] chore: enable 'warn_redundant_casts' for mypy Enable 'warn_redundant_casts'for mypy and resolve one issue. --- gitlab/v4/objects/keys.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gitlab/v4/objects/keys.py b/gitlab/v4/objects/keys.py index 46f68946c..c03dceda7 100644 --- a/gitlab/v4/objects/keys.py +++ b/gitlab/v4/objects/keys.py @@ -31,4 +31,4 @@ def get( server_data = self.gitlab.http_get(self.path, **kwargs) if TYPE_CHECKING: assert isinstance(server_data, dict) - return cast(Key, self._obj_cls(self, server_data)) + return self._obj_cls(self, server_data) diff --git a/pyproject.toml b/pyproject.toml index 8e9920ec3..62e0bfbeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ disallow_incomplete_defs = true disallow_subclassing_any = true disallow_untyped_decorators = true disallow_untyped_defs = true +warn_redundant_casts = true warn_unused_configs = true warn_unused_ignores = true @@ -21,7 +22,6 @@ warn_unused_ignores = true # no_implicit_optional = true # no_implicit_reexport = true # strict_equality = true -# warn_redundant_casts = true # warn_return_any = true [[tool.mypy.overrides]] # Overrides for currently untyped modules pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy