Skip to content

Stop src/modal shadowing the modal library in the executor's Pyright check #868

Closed

Description

@anth-volk

Problem

The executor's Modal app modules live in src/modal/. Pyright adds src as an import root when no extraPaths is configured, so import modal in those modules resolves to the local src/modal directory instead of the installed modal library. Every modal attribute is then unknown: 47 of the executor's Pyright errors, tolerated by rules/baselines/pyright-executor.txt under sim.quality.pyright-executor (#864), come from this, and the shadowing hides real errors in the code that uses modal.

At runtime src is never an import root: the package is installed from src, and the app modules import each other as src.modal.<module> from the project directory.

Proposal

Set extraPaths = [] in the executor's [tool.pyright], a Pyright-only setting that changes nothing about how Modal loads the apps, and fix the 9 errors it exposes without growing the baseline:

  • the routing-state Dict typed as possibly None in update_version_registry;
  • modal.current_function_call_id() returning str | None in the budget-window batch;
  • the precompute RemoteFunction protocol, which Modal functions don't satisfy;
  • a segmented national span hiding a return.

Renaming or moving src/modal isn't needed.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions