Skip to content

"Redundant" env markers removed in 0.11.25 break exported lockfile #20147

Closed

Description

@bastimeyer

Summary

The changes introduced in #19933 have broken lockfile exporting. With uv <0.11.25, everything was working fine. Our project doesn't have a tool.uv.environments configuration.

Here's what happened:

Our CI tests need to export the lockfile into the requirements.txt format by running uv export --frozen --all-extras --group test --format requirements-txt. The reasons for this are irrelevant.

One of our transitive dependencies is backports-zstd (via urllib3[zstd]), which backports the zstd module of the stdlib on older Python versions and which is incompatible on Python 3.14 and above:

[[package]]
name = "urllib3"
version = "2.7.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" }
wheels = [
    { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" },
]

[package.optional-dependencies]
brotli = [
    { name = "brotli", marker = "platform_python_implementation == 'CPython'" },
    { name = "brotlicffi", marker = "platform_python_implementation != 'CPython'" },
]
zstd = [
    { name = "backports-zstd", marker = "python_full_version < '3.14'" },
]

Exporting this results in the python_full_version < '3.14' marker to be included, so when running on Python 3.14, this dependency will be skipped, as expected.

$ uv export --frozen --all-extras --group test --format requirements-txt | grep backports-zstd
backports-zstd==1.5.0 ; python_full_version < '3.14' \

However, now with #19933 merged and included in uv >=0.11.25, when updating the lockfile (e.g. by adding a new dependency and running uv lock --no-upgrade), the "redundant" markers will be removed:

[[package]]
name = "urllib3"
version = "2.7.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz", hash = "sha256:231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c", size = 433602, upload-time = "2026-05-07T16:13:18.596Z" }
wheels = [
    { url = "https://files.pythonhosted.org/packages/7f/3e/5db95bcf282c52709639744ca2a8b149baccf648e39c8cc87553df9eae0c/urllib3-2.7.0-py3-none-any.whl", hash = "sha256:9fb4c81ebbb1ce9531cce37674bbc6f1360472bc18ca9a553ede278ef7276897", size = 131087, upload-time = "2026-05-07T16:13:17.151Z" },
]

[package.optional-dependencies]
brotli = [
    { name = "brotli", marker = "platform_python_implementation == 'CPython'" },
    { name = "brotlicffi", marker = "platform_python_implementation != 'CPython'" },
]
zstd = [
    { name = "backports-zstd" },
]

This results in backports-zstd losing its env marker in the exported requirements.txt format, and an env based on Python 3.14 will attempt to install it, which will not work and result in a build error.

$ uv export --frozen --all-extras --group test --format requirements-txt | grep backports-zstd
backports-zstd==1.5.0 \

Platform

any

Version

0.11.26

Python version

3.14.6

Activity

  1. zanieb commented on Jul 6, 2026

    @zanieb
    Member

    Thanks for the report. This seems unintentional, I believe we can reconstruct the full markers on export.

  2. self-assigned this
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions