You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use case: I have a folder where i write and keep my script relevant to a certain project / dependency setup which references a local index. I want to share a script with a colleague for him to reproduce but I want to share only one necessary file and not a full folder with all the other files he doesnt need.
Setup of the folder:
uv init
cd
uv add --index internal=
Before sending him the script, I need to copy the dependencies into the script. There are two possible ways i would solve this, both not working as expected:
❯ : uv add --script .py -r pyproject.toml
error: Adding requirements from a pyproject.toml is not supported in uv add
uv export creates an requirements-txt format which does not include the index nor the linking of the dependency to this index.
When running the script with uv run without it being located in this project folder it will not be able to resolve the dependency as it is missing the index information.
It's intentional that uv export drops the index information. requirements.txt is much more restrictive, and we can't represent things like explicit or assigned indexes.
Summary
Use case: I have a folder where i write and keep my script relevant to a certain project / dependency setup which references a local index. I want to share a script with a colleague for him to reproduce but I want to share only one necessary file and not a full folder with all the other files he doesnt need.
Setup of the folder:
Before sending him the script, I need to copy the dependencies into the script. There are two possible ways i would solve this, both not working as expected:
❯ : uv add --script .py -r pyproject.toml
error: Adding requirements from a
pyproject.toml
is not supported inuv add
❯ : uv export | uv add --script .py -r -
Resolved 3 packages in 194ms
Updated
<script-name>.py
uv export creates an requirements-txt format which does not include the index nor the linking of the dependency to this index.
When running the script with uv run without it being located in this project folder it will not be able to resolve the dependency as it is missing the index information.
Platform
Windows 11 x86_64
Version
uv 0.5.24 (42fae92 2025-01-23)
Python version
Python 3.12.5
The text was updated successfully, but these errors were encountered: