Remove obsolete "type: ignore" comment - #632
Conversation
python/typeshed#15742 is now fixed so this should not be needed any more
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #632 +/- ##
=======================================
Coverage 97.81% 97.81%
=======================================
Files 23 23
Lines 5715 5715
Branches 352 352
=======================================
Hits 5590 5590
Misses 75 75
Partials 50 50 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Ah, I was too impatient –
|
Confidence Score: 4/5Not safe to merge until the Python 3.11 mypy error introduced by this change is resolved. A before-and-after comparison using the pinned mypy version shows the parent source passes the focused check and the changed source fails specifically on Files Needing Attention:
What T-Rex did
Comments Outside Diff (1)
Reviews (1): Last reviewed commit: "Remove obsolete "type: ignore" comment" | Re-trigger Greptile |
| # Silence mypy warning as cleanup_socket is not yet annotated in | ||
| # typeshed: https://github.com/python/typeshed/issues/15742 | ||
| cleanup_socket=False, # type: ignore[call-arg] | ||
| cleanup_socket=False, |
There was a problem hiding this comment.
The project’s Python 3.11 lint job uses pinned mypy==1.10.1, whose available create_unix_server signature does not include the Python 3.13-only cleanup_socket parameter. Removing this targeted suppression adds an Unexpected keyword argument "cleanup_socket" [call-arg] failure even though the branch is runtime-guarded. Restore the # type: ignore[call-arg] or use an equivalent mypy-compatible compatibility wrapper.
Artifacts
Parent focused mypy comparison script
- Authored shell script extracts the parent controller and runs the pinned focused mypy check, ending with the check's exit status.
- Authored shell script runs the pinned focused mypy check against the changed controller, ending with the check's exit status.
Parent focused mypy check passes
- Captured parent-source mypy output reports no issues and exit code 0, establishing the before condition.
HEAD focused mypy check fails on cleanup_socket
- Captured changed-source mypy output reports the unexpected cleanup_socket keyword at controller.py:456 and exit code 1, proving the regression.
Parent CI mypy reproduction script
- Authored shell script exports the parent tree and runs the CI-equivalent bare mypy command, ending with the command's exit status.
HEAD CI mypy reproduction script
- Authored shell script runs the CI-equivalent bare mypy command in the changed checkout, ending with the command's exit status.
Parent CI mypy baseline output
- Captured parent full-mypy output contains five pre-existing missing-stub errors and exit code 1, establishing the CI baseline.
HEAD CI mypy output adds cleanup_socket failure
- Captured changed full-mypy output contains the five baseline errors plus the new controller cleanup_socket call-argument error, proving the additional failure.
Focused Unix-socket test script
- Authored shell script runs the repository's focused Unix-socket controller tests and records their exit status.
HEAD Unix-socket controller tests pass
- Captured focused pytest output shows all three Unix-socket controller tests passing on Python 3.11, confirming unchanged reachable runtime behavior.
|
Bear in mind that we'll hopefully run MyPy against a range of Python versions so depending on how far back the upstream fix gets backported, we'll need to keep having the ignore in place but track the respective date for when it could get removed for good (maybe via https://endoflife.date/python + an issue). |
python/typeshed#15742 is now fixed so this should not be needed any more
What do these changes do?
Removes a "type: ignore" comment which should no longer be needed.
Are there changes in behavior for the user?
No.
Related issue number
Checklist
{py36,py37,py38,py39}-{nocov,cov,diffcov}, qa, docs{py36,py37,py38,py39}-{nocov,cov,diffcov}{py36,py37,py38,py39}-{nocov,cov,diffcov}, pypy3-{nocov,cov}, qa, docs{py36,pypy3}-{nocov,cov,diffcov}, qapy36-{nocov,cov,diffcov}, qa, docsNEWS.rstfile