Skip to content

Commit

Permalink
Pass mypy and link issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Sep 18, 2024
1 parent 3c34165 commit 62f015d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 8 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ explicit_package_bases = True
disable_error_code =
# Disable due to many false positives
overload-overlap,

# jaraco/cssutils#11
[mypy-cssutils.*]
ignore_missing_imports = True

# jaraco/tempora#35
[mypy-tempora.*]
ignore_missing_imports = True
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dependencies = [
"lxml>=2.0",
"more_itertools>=6",
"tempora>=1.3",
'importlib_resources; python_version < "3.7"',
]
dynamic = ["version"]

Expand Down Expand Up @@ -69,11 +68,8 @@ type = [
"pytest-mypy",

# local
"lxml-stubs",
]


[tool.setuptools_scm]


[tool.pytest-enabler.mypy]
# Disabled due to jaraco/skeleton#143
8 changes: 2 additions & 6 deletions svg/charts/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion svg/charts/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 62f015d

Please sign in to comment.