From dacaa18d6a51a29113bb90fc283611fa11ff3485 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 | 34 ++++++++++++++++++++++++++++++++++ pyproject.toml | 4 ---- recapturedocs/jsonpickle.py | 8 ++++++-- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/mypy.ini b/mypy.ini index 83b0d15..35ca081 100644 --- a/mypy.ini +++ b/mypy.ini @@ -12,3 +12,37 @@ explicit_package_bases = True # Disable overload-overlap due to many false-positives disable_error_code = overload-overlap + +# 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..66ed3f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,7 +99,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():