-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Constraint flag for uv add #6518
Copy link
Copy link
Closed
Labels
enhancementNew feature or improvement to existing functionalityNew feature or improvement to existing functionality
Description
Hi, can we instead add a new flag -c / --constraint to uv add, so that you can pass in constraint files directly? I think currently you can do this by adding a constraint to a requirements.txt file, then running uv add --requirements requirements.txt, but this would embed it directly in the command.
My specific use case is using Apache Airflow which only supports pip (not Poetry etc) because it basically requires constraint files, see https://github.com/apache/airflow/blob/main/README.md#installing-from-pypi
That way, I can do (copying from their example):
uv add 'apache-airflow==2.10.0' \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.10.0/constraints-3.8.txt"
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or improvement to existing functionalityNew feature or improvement to existing functionality