astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
21.97k stars 641 forks source link

pip compile --universal does not retain environment markers for dependencies #4584

Closed houbie closed 3 months ago

houbie commented 3 months ago

Steps to reproduce: echo poetry | uv pip compile --universal - adding --no-strip-markers yields the same result.

Outcome:

...
xattr==1.1.0
    # via poetry

xattr is not available for windows, so the generated requirements will fail to install on windows.

Expected outcome:

...
xattr==1.1.0; sys_platform == "darwin"
    # via poetry

From poetry's sdist: Requires-Dist: xattr (>=1.0.0,<2.0.0) ; sys_platform == "darwin"

zanieb commented 3 months ago

Thanks for the report, looks like a bug but someone who's working on the lock file will check in.

charliermarsh commented 3 months ago

Thanks, not immediately clear why it's being omitted there, looking now.

charliermarsh commented 3 months ago

(uv lock does correctly include the marker.)

charliermarsh commented 3 months ago

Ahh ok, the problem is that the dependency graph has a cycle, because poetry-plugin-export has a dependency on poetry. Very interesting... Will fix.

charliermarsh commented 3 months ago

Fixed in #4595.

houbie commented 3 months ago

that was super responsive 🚀 I just replaced pip with uv in pyprojectx and the integration tests became 4x faster 🥳 Looking forward to the next release

charliermarsh commented 3 months ago

Awesome, thanks!