Fix errors reported by mypy by aucampia · Pull Request #1330 · RDFLib/rdflib (original) (raw)
Yes, I use MyPy in PySHACL and in the Sanic project, for static type analysis during CI build. It is indeed a very powerful and useful tool. I like using it, and I believe all new modern Python software projects should incorporate MyPy type checking from the start.
However I'm not sure it makes sense to use it in the RDFLib project. A very large portion of contributors to RDFLib are not software engineers. One of the primary reasons that academics, researchers, and scientists use Python is because of the low barrier to entry, and one of those points of ease is the dynamic and untyped nature.
We've seen in the past some contributors are frustrated by the existing PEP8 requirements and our preference (not requirement) for Black formatted code. Its a balancing act between having high quality code contributions, and having any contributions at all. Adding yet another barrier to contribution, another hurdle to jump, another dev-dependency to install, another required tool contributors have to learn and to use, sounds like a bad idea to me.
Having said all that, I am in favour of the software engineers in our community to add the type annotations, run MyPy locally, and fix the errors it raises, then push those annotations and fixes as a PR. I don't think there is any need to add it to the CI pipelines.