Move mypy configuration from pre-commit hook to pyproject.toml #342
Copy link
Copy link
Open
Labels
Continuous IntegrationGitHub Actions / workflow issueGitHub Actions / workflow issueS - size SmallMagnitude in hours.Magnitude in hours.nice to haveNot necessary.Not necessary.priorityGive Priority at next Sprint Planning.Give Priority at next Sprint Planning.technical dept / refactoringNon-functional change. Improvement for developers but not for users.Non-functional change. Improvement for developers but not for users.
Description
mypy is currently configured via --strict in the pre-commit hook args only.
Move configuration to [tool.mypy] in pyproject.toml so settings are:
- Visible and documented alongside other tool configurations
- Usable from IDE and CI without relying on pre-commit
- Consistent with project standards for tool configuration
Metadata
Metadata
Assignees
Labels
Continuous IntegrationGitHub Actions / workflow issueGitHub Actions / workflow issueS - size SmallMagnitude in hours.Magnitude in hours.nice to haveNot necessary.Not necessary.priorityGive Priority at next Sprint Planning.Give Priority at next Sprint Planning.technical dept / refactoringNon-functional change. Improvement for developers but not for users.Non-functional change. Improvement for developers but not for users.
Activity
jarl-hoyem commentedon Mar 16, 2026
Example from:
https://github.com/thu-ml/tianshou/blob/master/pyproject.toml
[tool.mypy]
allow_redefinition = true
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
no_implicit_optional = true
pretty = true
show_error_codes = true
show_error_context = true
show_traceback = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
exclude = "^build/|^docs/"
jarl-hoyem commentedon May 27, 2026
This issue is now blocking: PR #404 removed a legitimate
type: ignore[override]suppression because mypy was not in CI to catch the regression. Adding mypy to
CI via pyproject.toml should include running it in the python-package.yml workflow.
ahmedmajid22 commentedon May 28, 2026
Taking this on. Will move mypy config to [tool.mypy] in pyproject.toml and add mypy to the CI workflow
jarl-hoyem commentedon Jun 2, 2026
Pull requests was rejected on formal grounds. Issue is still relevant and has priority.
Apart from strict only keep these from the original ones above:
pretty = true
show_error_codes = true
show_error_context = true
show_traceback = true