Fix mypy errors by updating to Python 3.10 and excluding open_print_tag files #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The mypy configuration specified Python 3.9, but the codebase uses Python 3.10+ pattern matching syntax (
match/case), causing type checking failures.Changes
mypy.ini: Updated
python_versionfrom 3.9 to 3.10 to match CI workflow requirements and added missing import stubs for external libraries (cbor2,numpy,simple_parsing,pn5180_tagomatic,record,common)GitHub Actions workflow: Updated
.github/workflows/mypy.ymlto excludeopen_print_tag/files from type checking, matching the Makefile'stypechecktarget pattern. Only*.pyandlib/*.pyfiles are now checked.Type annotation fixes in lib/ files:
lib/openprinttag_parser.pyandlib/spoolman_client.pyAnytype annotations for dynamic data from tag parsingDict[str, Any]annotation to fix incompatible types# type: ignore[import-not-found]for imports from external OpenPrintTag codeThe external OpenPrintTag files under
open_print_tag/are now excluded from mypy checking as they are third-party code copied from the Prusa OpenPrintTag project.Example fix pattern:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.