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

Per-platform overrides #2142

Closed
mjclarke94 opened this issue Mar 3, 2024 · 8 comments
Closed

Per-platform overrides #2142

mjclarke94 opened this issue Mar 3, 2024 · 8 comments
Labels
question Asking for clarification or support

Comments

@mjclarke94
Copy link

Generally speaking, version resolution is platform independent for the majority of dependencies, with only a subset (torch...and others...mostly torch) needing a nudge in the right direction. Cross-platform support is probably the main thing preventing us from adopting uv/rye at the moment, as we build on MacOS but deploy on Linux. There's already an open issue for cross platform support (#2079), but I imagine implementing that is a fairly involved process.

As a short term solution to unblock the adoption of uv until cross-platform version resolution is implemented, overrides.txt could allow the pinning of versions on a per-platform basis.

@charliermarsh
Copy link
Member

So in some sense, I think that overrides already do allow this, because you can provide multiple overrides for a single package, like:

pywin32 > 1.0 : sys.platform == 'win32'
pywin32 < 1.0 : sys.platform != 'win32'

With this, whenever we see pywin32, we'll replace it with both of these, so only the one that applies to the given platform will end up being activated.

Would this work for what you're describing?

@charliermarsh charliermarsh added the question Asking for clarification or support label Mar 3, 2024
@mjclarke94
Copy link
Author

Ah, maybe. I'm dealing with torch specifically, so have to deal with the issue of changing the pypi index url on a per-platform basis.

@pamelafox
Copy link

I'm not sure if my question is the same question or a different one, but it seems related. Does uv already support the functionality of https://pypi.org/project/pip-compile-cross-platform/ ? Can we compile once, and have it keep the markers for different OSes in the resulting requirements.txt file?

@charliermarsh
Copy link
Member

@pamelafox -- We don't quite support that yet. That tool looks like a wrapper around Poetry which does a platform-agnostic resolution. We're going to support that in the future, but right now we only lock for a single platform (like pip-compile).

@danieleades
Copy link
Contributor

@pamelafox -- We don't quite support that yet. That tool looks like a wrapper around Poetry which does a platform-agnostic resolution. We're going to support that in the future, but right now we only lock for a single platform (like pip-compile).

is there somewhere we can track progress towards platform-agnostic resolution?

@inoa-jboliveira
Copy link

inoa-jboliveira commented Apr 15, 2024

Hi @charliermarsh We would like to be able to uv pip compile on requirementes.in file cross platform, i.e. from a same uv install create different txt files for windows, linux, mac. Is this the right issue or should I create a separated one?

@charliermarsh
Copy link
Member

@inoa-jboliveira -- I think that's best tracked as part of #2679. (We're building some prototypes for it now.)

@zanieb
Copy link
Member

zanieb commented Jun 19, 2024

See also #3347 for cross-platform lock files.

I don't know if there's a clear todo here regarding per-platform overrides so I'm going to close this. Let me know if we're missing something.

@zanieb zanieb closed this as completed Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

6 participants