Skip to content

NAS-145295 / 28.0.0-BETA.1 / Switch to mypy - #111

Merged
yocalebo merged 3 commits into
masterfrom
switch-to-mypy
Nov 17, 2026
Merged

yocalebo merged 3 commits into
masterfrom
switch-to-mypy

Conversation

@yocalebo

Copy link
Copy Markdown
Contributor

pytype is dead (also miserably slower compared to mypy)

Pytype is no longer developed and does not support Python 3.13, and it is slow. The type check now runs mypy on Python 3.13. The job keeps the name type-check so existing required checks still match. The pytype comments in the code are removed or replaced with their mypy equivalent.
Mypy found errors that pytype did not report. Most were missing or loose annotations. The JSON-RPC message types are now final so mypy can narrow them by key, and an error response id may be None as JSON-RPC allows.

One fix changes behavior. When the server sends a global error that the client cannot parse, pending calls now raise a ClientException instead of quietly returning None.
@yocalebo
yocalebo requested a review from a team November 17, 2026 16:41
@bugclerk bugclerk changed the title Switch to mypy NAS-145295 / 28.0.0-BETA.1 / Switch to mypy Nov 17, 2026
@bugclerk

Copy link
Copy Markdown

@yocalebo

Copy link
Copy Markdown
Contributor Author

time 00:20

By default mypy skips the bodies of functions that have no type annotations, and pytype checked them. Mypy now checks them too, which found more errors in the package and the tests. This commit fixes them without changing runtime behavior.
@yocalebo
yocalebo merged commit fcb1b7f into master Nov 17, 2026
4 checks passed
@yocalebo
yocalebo deleted the switch-to-mypy branch November 17, 2026 17:16
@bugclerk

Copy link
Copy Markdown

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Nov 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants