Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must the executable name match package name when using uv tool run package #7729

Closed
gitgithan opened this issue Sep 27, 2024 · 3 comments
Closed
Assignees
Labels
question Asking for clarification or support

Comments

@gitgithan
Copy link

gitgithan commented Sep 27, 2024

Command ran: uv tool run toolong
Output:

The executable `toolong` was not found.
warning: An executable named `toolong` is not provided by package `toolong`.
The following executables are provided by `toolong`:
- tl

https://github.com/Textualize/toolong

I believe the issue is uv is expecting the executable name (tl) to be the same as package name (toolong).
Is a workaround like below necessary?

It can work with uv run --with toolong -- tl file.log though after getting inspiration from sample at https://docs.astral.sh/uv/concepts/tools/#relationship-to-uv-run.
Is this a workaround or i'm not using uv tool run and uv run properly?

Why did uv tool run api get invented if uv run looks like it covers the same things that uv tool run does?

I noticed uv run has --python to download python version on demand but uv tool does not have --python.
Does this mean when using uv tool the python we want must already exist and be set as default?

I wish the docs had an explicit summary table/diagram on what is being automated for each API.

  • python download
  • venv creation
  • library installation

Currently i'm reading in docs and ctrl+f/eyeballing keywords to find this information.

uv platform: WSL2
uv version: uv 0.4.15

@charliermarsh
Copy link
Member

The intended use is uv tool run --from toolong tl. uv tool run (uvx) and uv run serve different purposes. The former installs an executable for global use (like pipx), while the latter runs a command within a project. So uv run will have access to any dependencies defined in a pyproject.toml, while uv tool run can be used anywhere to run a dedicated executable.

@charliermarsh
Copy link
Member

uv tool run does support --python, as in uv tool run --python 3.10 --from toolong tl.

@charliermarsh charliermarsh added the question Asking for clarification or support label Sep 27, 2024
@charliermarsh charliermarsh self-assigned this Sep 27, 2024
@zanieb
Copy link
Member

zanieb commented Sep 27, 2024

There's some more background on the tool interface in #3560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

3 participants