RDFLib / pySHACL

A Python validator for SHACL
Apache License 2.0
241 stars 63 forks source link

Enable mypy review for pyshacl.cli:main and fix reported issues #192

Closed ajnelson-nist closed 3 months ago

ajnelson-nist commented 11 months ago

This patch updates the results of mypy --ignore-missing-imports, run only against /pyshacl/cli.py:

Count Type-reviewed state
0 Current master branch state
40 Only designating main() -> None
0 Committed state

This patch updates the results of mypy --ignore-missing-imports, run against /pyshacl:

Count Type-reviewed state
20 Current master branch state
61 Only designating main() -> None in cli.py
21 Committed state of cli.py
20 Committed state including main.py
ajnelson-nist commented 11 months ago

I've noticed type review hasn't passed for a while. So I included in this PR evidence that the number of issues at least doesn't grow, while the type-annotated coverage does.

ajnelson-nist commented 7 months ago

I checked running make dev ; make type-check in a fresh virtual environment, and it looks like the current Drone-reported failures against Python 3.8 are happening in this PR and on the master branch. And one of the type issues is something I don't quite understand with importlib, but it looks like #214 might influence that type issue's resolution.

Also, having caught up with the 0.24.0 release, this PR now appears to have no influence on the number of typing issues reported. So, the effect of the PR has become that type signatures are added.

ajnelson-nist commented 3 months ago

I believe after #223 is merged and this PR gets a catch-up merge, this PR will pass the type-checking Make target as it's currently written. There just seems to be the question of what the return type of pyshacl.cli.main should be.

ajnelson-nist commented 3 months ago

I believe after #223 is merged and this PR gets a catch-up merge, this PR will pass the type-checking Make target as it's currently written. There just seems to be the question of what the return type of pyshacl.cli.main should be.

Catch-up merge applied.

ashleysommer commented 3 months ago

Okay, I'm happy to merge this now

ajnelson-nist commented 3 months ago

Thank you!

ashleysommer commented 2 months ago

This is released now in PySHACL v0.26.0