Repository navigation
build(python): upgrade mypy to 2.4.1 and make it runnable - #39
Merged
Merged
Conversation
mypy was pinned to 0.961 in both the Poetry dev group and the
pre-commit hook, and never actually ran: the empty root __init__.py
made mypy see each module under two names ("autoshift.query" and
"query"). Remove it, move mypy settings into [tool.mypy], bump to
2.4.1 with types-requests, fix the existing type errors without
changing runtime behaviour, and add a mypy job to the Tests workflow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the dev-group conflict with the combined dependency bump (#37), re-lock, and use actions/checkout@v7 and setup-python@v7 in the new mypy job to match the unittest job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
mypy was pinned to
0.961in both the Poetry dev group (^0.961, which Poetry reads as>=0.961,<0.962) and the pre-commit hook (mirrors-mypy rev: v0.961). The automated dependency update never proposed a bump because of those pins.It also never ran successfully. The empty root
__init__.pymade mypy treat the checkout as anautoshiftpackage, so every module was seen twice (autoshift.queryandquery) and mypy stopped with "Source file found twice under different module names". In a checkout folder whose name has a hyphen, it failed earlier still. Nothing importsautoshift.*, so the file is removed.Changes:
__init__.py.[tool.mypy]topyproject.toml(files,python_version = "3.11",ignore_missing_imports), so a plainmypycommand behaves the same locally, in pre-commit, and in CI.mypy = "^2.4.1", addtypes-requests. Re-locked. The lock also movesurllib31.26.9 → 2.8.0, whichtypes-requestsrequires; Docker and CI already get urllib3 2.x fromrequirements.txt.mirrors-mypyv2.4.1withtypes-requestsandbeautifulsoup4asadditional_dependencies; the arguments now come from the config.Testsworkflow: newmypyjob.Keyattributes on the classparse_shift_orcicorn.first_parsefunction attribute with a module-level flagOptional[str]defaults forShiftClientmigrationFunctionsDatabase.__exit__returnsNone(same behaviour asFalse)cast(str, …)on single-valued bs4 attributesmypy.Validation
mypy(2.4.1, runtime dependencies +types-requestsinstalled):Success: no issues found in 5 source filespre-commit run mypy --all-files: Passedpython -m unittest discover -s tests: 24 tests OKpython auto.py --help: OKflake8 *.py: no new warnings (103 vs 105 on master)master(fix(deps): bump runtime, dev, and CI dependencies #37); dev-group conflict resolved and re-locked. The new mypy job usescheckout@v7/setup-python@v7, matching the unittest job.mypy,unittest (Python 3.11)andunittest (Python 3.14)pass.🤖 Generated with Claude Code