RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.15k stars 555 forks source link

Fix typing issues that appeared after latest mypy update #2841

Closed ashleysommer closed 2 months ago

ashleysommer commented 2 months ago

The PR from dependabot to update to mypy v1.6.1 -> 1.8.0 was merged this afternoon https://github.com/RDFLib/rdflib/pull/2676

This caused some new mypy errors to appear. Nothing too hard to fix. Particularly funny are the unused-ignore errors. Its now an error to ignore an typing error where there is no typing error. I don't know if those original ignored typing errors are fixed in mypy v1.8.0, but the easiest fix is to add unused-ignore to the ignored errors for the affected lines, effectively ignoring the error thats thrown by ignoring an error that is not an error.

The other new mypy errors were real, possibly from some updated lxml typing information that was added, but they can also be worked around by some selectively placed typing information and some more ignore statements.