Skip to content

quality: pyright gate is red on macOS — 10 reportAttributeAccessIssue errors in desktop/appkit_events.py; CI green only because PyObjC is darwin-marked #217

Open

Description

@falbany

Description

The pyright gate is red on macOS despite CI being green: uv run pyright src/profiles reports 10 errors in src/profiles/desktop/appkit_events.py, all reportAttributeAccessIssue ("NSAppleEventManager / NSApplication / NSObject / NSAnyEventMask / NSDate / NSDefaultRunLoopMode are unknown import symbols", objc.selector unknown attribute). pyproject.toml:254-262 declares the gate: "Type checking gate (issue #69): pyright src/profiles must stay clean."

Why CI never sees it: the import lines carry # pyright: ignore[reportMissingImports] (appkit_events.py:133-137), and PyObjC is darwin-marked in uv.lock (marker = "sys_platform == 'darwin'"). On ubuntu CI the AppKit/Foundation imports don't resolve at all → reportMissingImports → suppressed → pass. On macOS the packages install, pyright resolves the modules, but PyObjC's dynamic bridge symbols aren't visible to static analysis → the different rule reportAttributeAccessIssue fires — which the ignores don't cover (pyright 1.1.414).

So every macOS contributor running the documented gate gets 10 errors that cannot be the intended signal, and any future genuine type error in this file is indistinguishable from the noise.

Steps to reproduce

uv run pyright src/profiles        # on macOS
# → 10 errors, 0 warnings  (src/profiles/desktop/appkit_events.py)

Suggested fix

  • Extend the existing ignore comments to [reportMissingImports, reportAttributeAccessIssue] on the AppKit/Foundation/objc import lines (and the objc.selector use at :239), or
  • Move the dynamic imports behind a small TYPE_CHECKING-free accessor module whose public functions return Any/object, so the dynamic-symbol noise is contained in one place.

Either way, add one macOS CI job (or a if: runner.os == 'macOS' pyright step) so the platform where the gate is actually exercised is the one that verifies it — otherwise the asymmetry recurs silently.

Activity

  1. added
    code-quality
    ci
    on Nov 22, 2026
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

    cicode-quality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions