From c8043cb482cfab045791d6d0a3d340c1f34a540b Mon Sep 17 00:00:00 2001 From: benoit Date: Mon, 11 Jul 2022 15:15:50 +0200 Subject: [PATCH 1/3] .gitignore --- .gitignore | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 570b1cb..ce42227 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ -*/__pycache__/ +__pycache__/ check_patroni.egg-info -test/*.state_file -test/vagrant/.vagrant +tests/*.state_file +tests/config.ini +vagrant/.vagrant .*.swp .venv/ dist/ +build/ From 64d87d505e17a21a94e3be2bacc1c2b6ae03b237 Mon Sep 17 00:00:00 2001 From: benoit Date: Mon, 11 Jul 2022 15:16:19 +0200 Subject: [PATCH 2/3] Black run --- check_patroni/cluster.py | 2 +- check_patroni/node.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check_patroni/cluster.py b/check_patroni/cluster.py index 4a00d59..11916a0 100644 --- a/check_patroni/cluster.py +++ b/check_patroni/cluster.py @@ -131,7 +131,7 @@ class ClusterConfigHasChanged(PatroniResource): self: "ClusterConfigHasChanged", connection_info: ConnectionInfo, config_hash: str, # Always contains the old hash - state_file: str, # Only used to update the hash in the state_file (when needed) + state_file: str, # Only used to update the hash in the state_file (when needed) ): super().__init__(connection_info) self.state_file = state_file diff --git a/check_patroni/node.py b/check_patroni/node.py index c1840d5..8c5d935 100644 --- a/check_patroni/node.py +++ b/check_patroni/node.py @@ -93,7 +93,7 @@ class NodeTLHasChanged(PatroniResource): def __init__( self: "NodeTLHasChanged", connection_info: ConnectionInfo, - timeline: str, # Always contains the old timeline + timeline: str, # Always contains the old timeline state_file: str, # Only used to update the timeline in the state_file (when needed) ) -> None: super().__init__(connection_info) diff --git a/setup.py b/setup.py index 37fae39..ffb4b97 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ setup( long_description=long_description, long_description_content_type="text/markdown", classifiers=[ - "Development Status :: 4 - Beta", # "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", # "Development Status :: 5 - Production/Stable", "Environment :: Console", "License :: OSI Approved :: PostgreSQL License", "Programming Language :: Python :: 3", From 6c0768099fef786349383056f06d2a7393c05cdc Mon Sep 17 00:00:00 2001 From: benoit Date: Mon, 11 Jul 2022 15:55:19 +0200 Subject: [PATCH 3/3] Adjust mypy.ini --- mypy.ini | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/mypy.ini b/mypy.ini index c005e8a..233fe5f 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,10 +1,29 @@ [mypy] -# no stubs for nagiosplugin => ignore: found module but no type hints or library stubs [import] -ignore_missing_imports = true -# no subs for nagiosplugin => ignore: Class cannot subclass "Summary" (has type "Any") [misc] -disallow_subclassing_any = false -# no stubs for nagiosplugin => ignore: Untyped decorator makes function "main" untyped [misc] -disallow_untyped_decorators = false - show_error_codes = true strict = true +exclude = build/ + +[mypy-setup] +ignore_errors = True + +[mypy-urllib3.*] +ignore_missing_imports = true + +[mypy-nagiosplugin.*] +ignore_missing_imports = true + +[mypy-check_patroni.types] +# no stubs for nagioplugin => ignore: Class cannot subclass "Resource" (has type "Any") [misc] +disallow_subclassing_any = false + +[mypy-check_patroni.node] +# no subs for nagiosplugin => ignore: Class cannot subclass "Summary" (has type "Any") [misc] +disallow_subclassing_any = false + +[mypy-check_patroni.cluster] +# no subs for nagiosplugin => ignore: Class cannot subclass "Summary" (has type "Any") [misc] +disallow_subclassing_any = false + +[mypy-check_patroni.cli] +# no stubs for nagiosplugin => ignore: Untyped decorator makes function "main" untyped [misc] +disallow_untyped_decorators = false