diff --git a/mypy.ini b/mypy.ini index 83b0d15..bdc1e59 100644 --- a/mypy.ini +++ b/mypy.ini @@ -12,3 +12,11 @@ explicit_package_bases = True # Disable overload-overlap due to many false-positives disable_error_code = overload-overlap + +# jaraco/cssutils#11 +[mypy-cssutils.*] +ignore_missing_imports = True + +# jaraco/tempora#35 +[mypy-tempora.*] +ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index 5a64aff..47019d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ dependencies = [ "lxml>=2.0", "more_itertools>=6", "tempora>=1.3", - 'importlib_resources; python_version < "3.7"', ] dynamic = ["version"] @@ -69,11 +68,8 @@ type = [ "pytest-mypy", # local + "lxml-stubs", ] [tool.setuptools_scm] - - -[tool.pytest-enabler.mypy] -# Disabled due to jaraco/skeleton#143 diff --git a/svg/charts/graph.py b/svg/charts/graph.py index 08afd16..7ee415d 100644 --- a/svg/charts/graph.py +++ b/svg/charts/graph.py @@ -6,14 +6,10 @@ import collections.abc import functools +import importlib.resources import itertools from operator import itemgetter -try: - import importlib.resources as importlib_resources # type: ignore -except ImportError: - import importlib_resources # type: ignore - import cssutils from lxml import etree @@ -724,7 +720,7 @@ def calculate_graph_dimensions(self): def load_resource_stylesheet(name, subs=None): if subs is None: subs = dict() - template = importlib_resources.read_text('svg.charts', name) + template = importlib.resources.read_text('svg.charts', name) source = template % subs return cssutils.parseString(source) diff --git a/svg/charts/time_series.py b/svg/charts/time_series.py index 1b73dcd..ff23b2d 100644 --- a/svg/charts/time_series.py +++ b/svg/charts/time_series.py @@ -155,7 +155,7 @@ def set_min_x_value(self, date): self._min_x_value = self.parse_date(date) # type check disabled due to python/mypy#4125 - min_x_value = property(get_min_x_value, set_min_x_value) # type: ignore + min_x_value = property(get_min_x_value, set_min_x_value) # type: ignore[assignment] def format(self, x, y): return fromtimestamp(x).strftime(self.popup_format)