Skip to content

Commit

Permalink
CI: add temporary mypy ignore because of importlib-metadata update
Browse files Browse the repository at this point in the history
The `imporlib-metadata` included a change in v4.8.1 that breaks `mypy`
for the `EntryPoint` class which it thinks no longer has a `name`
property. While that is not fixed, we have to temporarily ignore these
warnings.
  • Loading branch information
sphuber committed Aug 31, 2021
1 parent 832bcb4 commit 2a2bf21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions aiida/orm/nodes/process/calculation/calcjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ def tools(self) -> 'CalculationTools':
entry_point = get_entry_point_from_string(entry_point_string)

try:
tools_class = load_entry_point('aiida.tools.calculations', entry_point.name)
tools_class = load_entry_point(
'aiida.tools.calculations',
entry_point.name # type: ignore[attr-defined]
)
self._tools = tools_class(self)
except exceptions.EntryPointError as exception:
self._tools = CalculationTools(self)
entry_point_name = entry_point.name # type: ignore[attr-defined]
self.logger.warning(
f'could not load the calculation tools entry point {entry_point.name}: {exception}'
f'could not load the calculation tools entry point {entry_point_name}: {exception}'
)

return self._tools
Expand Down
2 changes: 1 addition & 1 deletion aiida/plugins/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def get_entry_point_string_from_class(class_module: str, class_name: str) -> Opt
group, entry_point = get_entry_point_from_class(class_module, class_name)

if group and entry_point:
return ENTRY_POINT_STRING_SEPARATOR.join([group, entry_point.name])
return ENTRY_POINT_STRING_SEPARATOR.join([group, entry_point.name]) # type: ignore[attr-defined]
return None


Expand Down

0 comments on commit 2a2bf21

Please sign in to comment.