fix: type errors resulting from new mypy by aucampia · Pull Request #2161 · RDFLib/rdflib (original) (raw)

Summary of changes

New mypy version is reporting new errors.

In the long run we need to switch to poetry so we can better control this.

Checklist

This PR has no runtime changes:

$ PYLOGGING_LEVEL=INFO task run -- git difftool -y -x $(readlink -f devtools/diffrtpy.py) upstream/main | tee /var/tmp/compact.diff task: [run] VIRTUAL_ENV="/home/iwana/sw/d/github.com/iafork/rdflib.reviews/.venv" PATH="/home/iwana/sw/d/github.com/iafork/rdflib.reviews/.venv/bin${PATH:+:${PATH}}" git difftool -y -x /home/iwana/sw/d/github.com/iafork/rdflib.reviews/devtools/diffrtpy.py upstream/main

2022-11-18T20:58:59.054 640638 139738907522880 030:WARNING root diffrtpy:40:clean_python failed to strip type hints from /tmp/git-blob-KQRDVq/algebra.py, falling back to using with type hints 2022-11-18T20:58:59.681 640638 139738907522880 030:WARNING root diffrtpy:40:clean_python failed to strip type hints from rdflib/plugins/sparql/algebra.py, falling back to using with type hints --- a/setup.cfg +++ b/setup.cfg @@ -55,10 +55,11 @@ warn_unused_configs = True ignore_missing_imports = True disallow_subclassing_any = False warn_unreachable = True warn_unused_ignores = True +no_implicit_optional = False

This is here to exclude the setup.py files in test plugins because these

confuse mypy as mypy think they are the same module.

exclude = (?x)( ^.test/plugins/./setup.py$