Skip to content

Type-Check the Carried hub_fetch_run.py So It Passes a Carrier's Strict Checker #4266

Closed

Description

@ptr727

Problem

Each downstream repository carries hub_fetch_run.py at its root. The hub type-checks no copy of it, since its own [tool.mypy] files and [tool.pyright] include both leave out catalog/. So nothing shows the helper passes the type checker a carrying repository runs.

Pyright passes it in basic and strict mode. mypy --strict reports one error, hub_fetch_run.py:90: error: Returning Any from function declared to return "str | None" [no-any-return].

Under CI, a carrying repository's checker reaches the root copy only where its own config puts the root in scope. Pyright with no include checks every file under its directory, the root included. A mypy config listing the root, or ., does the same. Such a repository then fails CI on a file it must not edit.

Found by the local strict review on the #4263 fix, which handles ruff only. The type checker is a separate class.

Done when

  • catalog/snippets/hub_fetch_run.py passes mypy --strict and strict pyright.
  • The hub type-checks that copy in its own gate, so a regression fails there first.
  • Or, where the maintainer prefers, the type-check commands carry an exclude for the root copy as the ruff calls do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions