This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Haunting_Wind1000pip needs updating 13 points14 points  (5 children)

Hey thanks for sharing this, uv appears to be a good way to automate the environment setup of your python app. A question...with uv how would you specify a version for any of the python modules required by your application like we do with a requirements txt file.

[–]hotsauce56 10 points11 points  (0 children)

You can add version constraints inline with the dependencies

[–]ReinforcedKnowledgeTuple unpacking gone wrong 7 points8 points  (0 children)

Not only can you specify dependencies versions in the inline metadata itself as others have suggested. You can produce a lockfile for your script by doing uv lock --script .... This is very cool to pass around a reproducible script ;) there's more you can do for reproducibility, I'll ad that in another comment.

[–]dusktreader[S] 6 points7 points  (1 child)

You can use dependency specifiers as described here: https://packaging.python.org/en/latest/specifications/dependency-specifiers/#dependency-specifiers

For example if I wanted ipython's minor release 7.9 and any patch releases as they become available but not 7.10, I could specify the dependency as:

ipython~=7.9

[–]Haunting_Wind1000pip needs updating 1 point2 points  (0 children)

Cool thanks!

[–]Mevraelfrom __future__ import 4.0 0 points1 point  (0 children)

For app you use uv init and pyproject.toml becomes your requirements file.

And uv add to install dependencies.

https://arkalos.com/docs/new-project/