uv
uv copied to clipboard
`uv pip compile`: Add a nicer (more automated) way of dealing with multiple files (e.g. main + dev dependencies)
I suggested this in a comment on another issue but maybe this deserves its own issue since it's quite a bit more than what I suggested in that issue itself:
How about a
uv pip compile --automode that looks forrequirements*.{in,txt}, checks if there are dependencies between them (e.g.-c requirements.txtin arequirements.something.in), and then compiles them in the proper order?This would also be REALLY amazing for upgrades. Imagine just being able to
uv compile --auto --upgrade-package somepackageif you want to upgrade that package, and uv then automatically updates it in your main dependencies and/or dev dependencies, depending on where it's defined :)
At the moment we work with a requirements.txt and a requirements-dev.txt. On a local dev system one will install the venv using both requirements files. Installing into a production Docker container, only the requirements.txt will be installed.
I came here while looking into if uv supports this use-case, and I'm not sure. Also not sure if this issue is addressing the same use-case. Some confirmation would be helpful @charliermarsh.
I did not yet play around with uv, only read the docs. I assume one would need to specify two requirements.in files? I do like the approach of the javascript world where both type of dependencies are defined in the package.json but with separate keys and it is possible to build for a target env (dev vs. prod). Given uv will work on a .lock file, I wonder if this will incorporate this use case and provide independent/dependent package resolutions. Installing the dev dependencies should not change versions on the main application dependencies etc. I have no insight on how this is done in package.json/package-lock.json, but I imagine that managing this package resolution isn't easy.
I hope this use-case is clear and something uv will consider to support. If it's not clear, I'm happy to expand. If it requires a separate issue to this one, I'm happy to create a new issue.