Skip to content

Stubs: no two stub paths may differ only by case (Shadow vs shadow breaks macOS/Windows) #44

Closed

Description

@b-re-w

Reported by pythonx-compose (#12). The Compose 1.11.1 stub set contains both androidx/compose/ui/graphics/shadow/__init__.pyi (a Kotlin package) and androidx/compose/ui/graphics/Shadow/__init__.pyi (a class module). On case-insensitive filesystems (macOS default, Windows) they collide: gh run download stops extracting after 136 of 246 files, mypy reports import-not-found, and an IDE on macOS cannot see both. PythonStubsTask only warns today.

Decided: stub layout must be case-unique. A class (or object) that the runtime exposes as a module under a parent package is emitted in the parent package's __init__.pyi (as the class), and gets its own <Class>/__init__.pyi only when that path does not collide case-insensitively with a sibling. The runtime import path is unchanged; only the stub layout changes, and the mypy consumer check must still resolve from androidx.compose.ui.graphics import Shadow and the shadow package.

Completion: generating Compose 1.11.1 stubs produces no two paths equal under casefold (test asserts it); the stubs artifact extracts fully with gh run download on macOS; tools/stubs/check-stubs.sh passes on macOS without the import ignore; the CI job may move back to (or add) macOS.

Activity

  1. b-re-w commented on Oct 3, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via #49.

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