Skip to content

Move mypy configuration from pre-commit hook to pyproject.toml #342

Open

Description

@jarl-hoyem

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

Activity

  1. jarl-hoyem commented on Mar 16, 2026

    @jarl-hoyem
    CollaboratorAuthor

    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/"

  2. jarl-hoyem commented on May 27, 2026

    @jarl-hoyem
    CollaboratorAuthor

    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.

  3. ahmedmajid22 commented on May 28, 2026

    @ahmedmajid22
    Collaborator

    Taking this on. Will move mypy config to [tool.mypy] in pyproject.toml and add mypy to the CI workflow

  4. self-assigned this
    on May 28, 2026
  5. jarl-hoyem commented on Jun 2, 2026

    @jarl-hoyem
    CollaboratorAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Continuous IntegrationGitHub Actions / workflow issueS - size SmallMagnitude in hours.nice to haveNot necessary.priorityGive Priority at next Sprint Planning.technical dept / refactoringNon-functional change. Improvement for developers but not for users.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions