Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lock dependencies that are not relevant to the platform the compile is running on #3672

Closed
rbtcollins opened this issue May 20, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@rbtcollins
Copy link

rbtcollins commented May 20, 2024

uv 0.1.44

With this requirements input file:

jupyterlab==4.2.0

running this command: uv pip compile --generate-hashes --no-header --no-strip-extras --python-version=3.11.9 -o foo.txt foo.in on a Linux host generates a foo.txt file that does not contain 'appnope'.

appnope is a platform_system specific dependency of the ipykernel:

https://github.com/ipython/ipykernel/blob/v6.29.4/pyproject.toml#L33
'appnope;platform_system=="Darwin"',

We want to lock our requirements, but having contributors run uv pip compile for every distinct platform seems like unnecessary toil. Even if a perfect job isn't possible, doing a usually-good-enough job would be fantastic.

Concrete proposal:

  • when encountering a platform specific conditional dependency, include it, preserving the condition. And for its dependencies, whatever they are, inject the same condition unless an alternative path leads to their unconditional inclusion.
@charliermarsh
Copy link
Member

You can do something like this to build a single requirements file for both platforms: #2679 (comment)

@charliermarsh
Copy link
Member

Unclear if we'll offer something like this in the pip compile API directly. We're already building platform-agnostic resolution support atop lockfiles. Perhaps as part of that we'll offer outputting a requirements file.

@charliermarsh charliermarsh added the enhancement New feature or request label May 20, 2024
@juledwar
Copy link

juledwar commented Jul 2, 2024

You can do something like this to build a single requirements file for both platforms: #2679 (comment)

What about allowing the use of multiple --platform flags? Obviously it would need to do environment markers.

@charliermarsh
Copy link
Member

By the way: we now support --universal which does this!

(We may eventually support allowing multiple --python-platform flags as a less general solution.)

@charliermarsh charliermarsh self-assigned this Jul 2, 2024
@juledwar
Copy link

juledwar commented Jul 2, 2024

I noticed --universal but I don't want everything as it slows down the whole run. I've gone from 1 hour on pip-compile to 5 minutes with UV because of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants