Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass mypy and link issues #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading