astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
19.94k stars 591 forks source link

Support including dependency executables (e.g., `--include-deps`) in `uv tool install` #6314

Open hynek opened 3 weeks ago

hynek commented 3 weeks ago

hi, congrats on 0.3.0!

I've noticed one very useful pipx option that uv tool is currently missing: --install-deps. It means that it also adds the CLIs of packages it depends on. This is crucial for something like Ansible where the essential commands are hidden in sub-packages.

ZingyAwesome commented 3 weeks ago

It would be great if this could allow multiple dependencies to be installed in the same venv and for all of their executables to be exposed. More info in this rye feature request. This would allow me to install ansible,ansible-core and ansible-lint in the same venv, saving disk space and negating version mismatch issues.

zanieb commented 3 weeks ago

I've been hesitant to provide a flag to install all executables from all dependencies — what about --executable <name> to include executables from dependencies?

mitsuhiko commented 3 weeks ago

The way it works in rye is that --include-dep names the particular dependency and installs then the tools that that particular dependency provides so it's not quite as crazy as installing all.

ZingyAwesome commented 3 weeks ago

Yeah that was what I meant, as long as you can specify multiple dependencies that way. My main issue with rye was that it allowed you to only specify 1 dependency to include executables from (or at least I couldn't get it to work with more than 1).

mitsuhiko commented 3 weeks ago

I thought --include-dep can be provided more than once, but maybe there is a bug.

hynek commented 3 weeks ago

I could perfectly live with uv tool install ansible --include-dep=ansible-playbook --include-dep=ansible --include-dep=ansible-inventory

Or however you call it; there's already the --with prefix used, so that might make sense too.

jamesharris-garmin commented 4 days ago

This for ansible's install workflow is the last piece of me replacing pipx with uv tool so supporting this would be excellent.