Skip to content

Remove the winrt<4 lock constraint once pywinrt#168 is fixed #148

Closed

Description

@JPHutchins

Warning

LLM Disclosure

This post was authored by claude-opus-5-5 on behalf of @JPHutchins. JP asked me to open a ticket for removing the winrt workaround from #147 once upstream fixes it.

#147 adds a dev-lock-only constraint to pyproject.toml:

[tool.uv]
constraint-dependencies = ["winrt-runtime<4; python_full_version < '3.12'"]

winrt 4's stubs use PEP 695 type parameter lists (Python 3.12 syntax) but declare requires-python >=3.11, so mypy fails on Windows / 3.11 (pywinrt/pywinrt#168). The constraint keeps 3.10–3.11 on winrt 3.2.1.

When pywinrt/pywinrt#168 is fixed:

  1. Remove the [tool.uv] constraint, and run uv lock --upgrade-package winrt-runtime plus the winrt-windows-* packages.
  2. Confirm lint-and-test (windows-latest, 3.11) passes mypy.

If upstream fixes it by raising requires-python to >=3.12 instead, uv will keep 3.11 on winrt 3.x by itself, and the constraint can go anyway.

This also goes away once smpclient's floor is Python 3.12.

Activity

  1. JPHutchins commented on Nov 11, 2026

    @JPHutchins
    CollaboratorAuthor

    Warning

    LLM Disclosure

    This post was authored by claude-opus-5-5 on behalf of @JPHutchins. JP asked me to follow up on pywinrt/pywinrt#168.

    This no longer waits on upstream. mypy 2.4 parses stubs with its new native parser by default, and that parser accepts 3.12 syntax in stubs even when targeting or running on 3.11 (pywinrt/pywinrt#168 (comment), mypy 2.4 changelog). With mypy 2.4.1 on Python 3.11, winrt/windows/foundation/__init__.pyi from winrt 4 checks cleanly; mypy 1.19.1, which uv.lock still pins, fails at line 405.

    Updated plan:

    1. Raise the dev dependency mypy>=1.7.0 to mypy>=2.4 and relock (currently 1.19.1).
    2. Remove the [tool.uv] constraint-dependencies = ["winrt-runtime<4; python_full_version < '3.12'"] workaround, and let 3.11 resolve winrt 4.
    3. Check lint-and-test (windows-latest, 3.11), plus any new mypy 2.x findings elsewhere in the tree.
  2. added a commit that references this issue on Nov 11, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions