Skip to content

Universal Windows lock cannot sync on free-threaded Python 3.13 #23239

Open

Description

@notatallshaw

Summary

uv lock selects Pympler 1.1 and pywin32 312, but that lock fails on free-threaded Windows Python 3.13. Pympler 1.0.1 works for both builds.

Some form of this happens with all the universal Python lockers I tested (uv, Poetry, PDM, and nab), partly because I don't think any lock file format (standard or non-standard) allows you to express marker selection based on free-threadedness.

[project]
name = "repro"
version = "0"
requires-python = ">=3.13,<3.14"
dependencies = ["pympler"]

[tool.uv]
environments = ["sys_platform == 'win32'"]
required-environments = ["sys_platform == 'win32'"]
uv lock --python 3.13
uv sync --locked --dry-run --python 3.13t --python-platform x86_64-pc-windows-msvc

Sync output:

Using CPython 3.13.12+freethreaded
Would create project environment at: <project-env>
Resolved 3 packages in 0.73ms
error: Distribution `pywin32==312 @ registry+https://pypi.org/simple` can't be installed because it doesn't have a source distribution or wheel for the current platform

The result is unchanged with --python 3.13t when locking or fork-strategy="fewest".

Platform

Ubuntu 26.04.1 LTS, x86_64 (WSL2); target: Windows AMD64

Version

uv 0.13.8 (x86_64-unknown-linux-gnu)

Python version

CPython 3.13.12 and CPython 3.13.12+freethreaded

Activity

  1. notatallshaw commented on Nov 13, 2026

    @notatallshaw
    CollaboratorAuthor

    For reference this came from me building a single lock file for dev/ci for packaging.

    Here are the other issues I raised on this:

    Poetry issue: python-poetry/poetry#11228
    PDM issue: pdm-project/pdm#4006
    nab partial workaround: notatallshaw/nab#1576

    While I did hit this as a real world issue, I don't consider it that high priority.

  2. darshpatel1052 commented on Nov 14, 2026

    @darshpatel1052

    Hey, I'd be interested in investigating this.

    The tricky part seems to be that regular and free-threaded Python builds can have different compatible distributions, but the universal lock doesn't have a straightforward way to express that distinction.

    I was thinking of starting by tracing how wheel compatibility is evaluated during universal resolution versus sync, particularly why the lock selects a dependency that can't be installed on the free-threaded target.

    Depending on what's supported by the lockfile format, we could look at whether this needs a resolution-level change or whether an earlier compatibility check with a clearer diagnostic would be a reasonable first step.

    Does that sound worth exploring? I'd be happy to take this up if the direction makes sense.

  3. konstin commented on Nov 16, 2026

    @konstin
    Member

    The solution to this would be PEP 780 by adding "free_threaded::True" in sys_abi_info to required-environments, which defines a marker for this. CC @rgommers for the story for that PEP.

  4. rgommers commented on Nov 16, 2026

    @rgommers

    Thanks for the ping. Yes, this will be solved by PEP 780 - and I just posted a large update of that PEP then days ago. I think we'll be submitting the PEP for pronouncement soon unless any concerns arise (no comments in 10 days on the PEP thread on DPO).

  5. added
    enhancement
    on Nov 19, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions