Skip to content

Count a setup.cfg [mypy] Section as a Declared Directory's Type Checker #1915

Closed

Description

@ptr727

Problem

The hub validator's Type check Python step in .github/workflows/validate-task.yml chooses mypy for a declared Python directory when its pyproject.toml has a [tool.mypy] section, or when a mypy.ini or .mypy.ini sits beside it. mypy also reads a [mypy] section from setup.cfg. A declared directory configured only that way fails with "configures neither mypy nor pyright", even though mypy would run.

Fix

Also count a [mypy] section in <dir>/setup.cfg, for a declared directory only (the undeclared root reads only the pyproject.toml sections, as it always has). Add a case to test_type_check_picks_its_checker_and_environment in scripts/tests/test_release_guards.py.

Found by the local strict review of #1914. No fleet repo is known to configure mypy this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions