From 911ea7d9bcd8e707a46c17db0969d714c221a148 Mon Sep 17 00:00:00 2001 From: Avasam Date: Tue, 27 Aug 2024 16:02:41 -0400 Subject: [PATCH] Pass mypy and link issues --- mypy.ini | 51 +++++++++++++++++++++++++++++++++++++ pyproject.toml | 6 ++--- recapturedocs/jsonpickle.py | 8 ++++-- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/mypy.ini b/mypy.ini index 83b0d15..aa1387e 100644 --- a/mypy.ini +++ b/mypy.ini @@ -12,3 +12,54 @@ explicit_package_bases = True # Disable overload-overlap due to many false-positives disable_error_code = overload-overlap + + +# jaraco/jaraco.mongodb#41 +[mypy-jaraco.mongodb.*] +ignore_missing_imports = True + +# jaraco/jaraco.itertools#20 +[mypy-jaraco.itertools.*] +ignore_missing_imports = True + +# jaraco/jaraco.text#17 +[mypy-jaraco.text.*] +ignore_missing_imports = True + +# jaraco/jaraco.logging#6 +[mypy-jaraco.logging.*] +ignore_missing_imports = True + +# jaraco/jaraco.email#4 +[mypy-jaraco.email.*] +ignore_missing_imports = True + +# jaraco/jaraco.fabric#8 +[mypy-jaraco.fabric.*] +ignore_missing_imports = True + +# jaraco/jaraco.modb#3 +[mypy-jaraco.modb.*] +ignore_missing_imports = True + +# cherrypy/cherrypy#1510 +[mypy-cherrypy.*] +ignore_missing_imports = True + +# jsonpickle/jsonpickle#441 +[mypy-jsonpickle.*] +ignore_missing_imports = True + +# shon/httpagentparser#93 +[mypy-httpagentparser.*] +ignore_missing_imports = True + +# dropbox/dropbox-sdk-python#419 +[mypy-dropbox.*] +ignore_missing_imports = True + +# TODO: Raise issues upstream +[mypy-fabric.*] +ignore_missing_imports = True +[mypy-genshi.*] +ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index 4e23512..aa4ba10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,8 @@ type = [ "pytest-mypy", # local + "boto3-stubs", + "botocore-stubs", "types-requests", "types-boto", "types-docutils", @@ -99,7 +101,3 @@ recapture-docs = "recapturedocs.server:handle_command_line" [tool.setuptools_scm] - - -[tool.pytest-enabler.mypy] -# Disabled due to jaraco/skeleton#143 diff --git a/recapturedocs/jsonpickle.py b/recapturedocs/jsonpickle.py index 8613f0a..4bb0171 100644 --- a/recapturedocs/jsonpickle.py +++ b/recapturedocs/jsonpickle.py @@ -2,6 +2,10 @@ A few handlers to make sure recapturedocs objects are serializable to JSON """ +from __future__ import annotations + +from typing import ClassVar + import jsonpickle # TODO: what types are returned for ResultSet and HIT? @@ -28,7 +32,7 @@ def restore(self, data): class OldStyleClassParamsHandler(jsonpickle.handlers.BaseHandler): - params = () + params: ClassVar[tuple[object, ...]] = () def flatten(self, obj, data): data.update(self._base.flatten(vars(obj))) @@ -42,7 +46,7 @@ def restore(self, data): class OldStyleClassParamsHandler_None(OldStyleClassParamsHandler): - params = (None,) # type: ignore + params = (None,) def setup_handlers():