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
I want to suggest a feature to allow UV to automatically manage packages as inline dependencies in a designated file (e.g., main.py).
When a package is added with uv add, it will also be appended to the dependencies list in the designated file (if UV_AUTO_ADD_INLINE_DEPS is set).
Integration with uv sync: A similar mechanism will apply to uv sync when a corresponding flag or environment variable is set.
The feature can be enabled via a CLI-Flag or as an environment variable UV_AUTO_MANAGE_INLINE_DEPS
Example
# uv
uv add requests --auto-add-inline-deps
# adds the following block to the py file that was added with "uv init"
/// script
dependencies = [
"requests",
]
///
This can be useful in scenarios where a developer wants to share the python file without providing the pyproject.toml.
Probably not the most common usecase but there might be additional benefits, can you think of one?
Open Questions
Should a specific file (e.g., main.py) always be targeted, or should this be configurable?
How should duplicate dependencies or conflicts be handled if they already exist in the inline list?
The text was updated successfully, but these errors were encountered:
I want to suggest a feature to allow UV to automatically manage packages as inline dependencies in a designated file (e.g., main.py).
The feature can be enabled via a CLI-Flag or as an environment variable UV_AUTO_MANAGE_INLINE_DEPS
Example
This can be useful in scenarios where a developer wants to share the python file without providing the pyproject.toml.
Probably not the most common usecase but there might be additional benefits, can you think of one?
Open Questions
The text was updated successfully, but these errors were encountered: