-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Migrating from pip-tools workflow to uv project #11661
Comments
Can you describe what you tried and what didn't work for your case? |
I don't think there's an easy way to use multiple |
@konstin I haven't tried any approach yet because I have no ideas to try. My mental model:
@zanieb I have two requirements.txt because I need to install a different tensorflow-text package based on the platform. Platform selector (probably not the right term?!) wasn't supported back then so I had to resort to
That compile to requirements.txt and requirements-macos.txt. If I can use platform==darwin and platform!=darwin in uv project definition and that get properly translated to single uv lockfile, I don't need multiple requirements files. |
You'd need to copy your Then, you can
Yes you can do this with markers, e.g., https://docs.astral.sh/uv/concepts/projects/dependencies/#platform-specific-dependencies |
(zanie wrote their response at the same time, sorry for the overlap)
The first two steps are correct, the third one is tricky. There's no 1:1 translation from locked requirement.txt to uv.lock due to the slightly different models (mainly that pip is platform specific and uv's lockfile is universal), but there's some tricks that can help you get close. One option is using constraints. Constraints use the same syntax as requirements and are passed explicitly, for the uv project interface in [tool.uv]
constraint-dependencies = ["...", "..."] You could add Another is doing the first with |
Question
Hey, i'm looking into migrating one of my projects from pip-tools to uv project.
I can't find a guidance on doing that. I'd like my versions in requirements.txt staying the same (and I have two different files for two different platforms) when i move to the uv's lockfile.
Platform
macOS, Windows
Version
uv 0.6.2
The text was updated successfully, but these errors were encountered: