diff --git a/conservancy_beancount/data.py b/conservancy_beancount/data.py index d176ce6..f044fab 100644 --- a/conservancy_beancount/data.py +++ b/conservancy_beancount/data.py @@ -95,7 +95,7 @@ class Posting(BasePosting): # of Beancount's type declaration being a smidge too specific: I think it # would be very unusual for code to actually require a dict over a more # generic mapping. If it did, this would work fine. - meta: MutableMapping[MetaKey, MetaValue] + meta: MutableMapping[MetaKey, MetaValue] # type:ignore[assignment] def iter_postings(txn: Transaction) -> Iterator[Posting]: @@ -103,5 +103,6 @@ def iter_postings(txn: Transaction) -> Iterator[Posting]: yield Posting( Account(source.account), *source[1:5], - PostingMeta(txn, index, source), + # see rationale above about Posting.meta + PostingMeta(txn, index, source), # type:ignore[arg-type] ) diff --git a/conservancy_beancount/plugin/__init__.py b/conservancy_beancount/plugin/__init__.py index 797bf57..10f4971 100644 --- a/conservancy_beancount/plugin/__init__.py +++ b/conservancy_beancount/plugin/__init__.py @@ -56,7 +56,8 @@ class HookRegistry: self.group_name_map.setdefault(key, set()).add(hook_cls) return hook_cls # to allow use as a decorator - def import_hooks(self, mod_name, *hook_names, package=__module__): + # This method is too dynamic to typecheck. + def import_hooks(self, mod_name, *hook_names, package=__module__): # type:ignore module = importlib.import_module(mod_name, package) for hook_name in hook_names: self.add_hook(getattr(module, hook_name))