Open j178 opened 2 months ago
Interesting. I don't think we should install executables from dependencies by default, but we should allow opt-in.
rye tools install
has a flag --include-dep <INCLUDE_DEP>
to include scripts from a given dependency, maybe uv
can allow something likes this.
I actually won't take this on right away, I've got to take care of some other things first if someone is interested. I think we need something like:
--executable <name>
: Only install the given executable name--include-package <package name>
: Include executables from the given dependency packageI'm a little unsure of the name for the second one. Maybe:
--include-dep
--include-executables
--executables-from
For --executable
, we need to decide if we'll scan dependencies if it's not found (we probably shouldn't for safety and performance but we could). If not, it's kind of separate from this issue.
We'll need to add included packages to the receipt, which is where most of the complexity is here.
Why would this not be uv tool install fastapi-cli?
And if fastapi-cli
doesn't depend on fastapi
, couldn't you do: uv tool install fastapi-cli --with fastapi
?
Although it seems like uvx fastapi --from fastapi-cli
just works?
Yeah uvx --from fastapi-cli fastapi ...
does seem like the proper invocation here — but we would need to support including dependency entry points for parity with Rye and pipx.
Yeah it just seems like it's kind of... the wrong way around, to include a dependency entrypoint. And it complicates the CLI a lot.
I agree it's a bit awkward. I think we should pursue #5017 and #5018 to help guide users to the correct path here and we can consider implementing this more complicated API based on additional feedback.
Ok, uv tool run jupyter
is a counterexample here. Right now, we suggest uv tool run --from jupyter-core jupyter
. And it's true that jupyter-core
contains the Jupyer executable... but you also need jupyer
installed in order to do, like, jupyter notebook
. Otherwise, you get: Jupyter command
jupyter-notebooknot found.
So the command in that case would really need to be... uv tool run --from jupyter-core --with jupyter jupyter notebook
.
For instance,
fastapi
doesn't have any entrypoints but it depends onfastapi-cli
, which provides an entrypoint namedfastapi
.uv tool install fastapi
would result in a failure, displaying the error messageNo executables found for fastapi
.But at the same time
uv tool run fastapi
works:Environment