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

uv run: List available scripts when a script is not specified #7687

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kakkoyun
Copy link
Contributor

@kakkoyun kakkoyun commented Sep 25, 2024

Signed-off-by: Kemal Akkoyun [email protected]

Summary

This PR adds the ability to list available scripts in the environment
when uv run is invoked without any arguments.
It somewhat mimics the behavior of rye run command
(See https://rye.astral.sh/guide/commands/run).

This is an attempt to fix #4024.

Test Plan

I added test cases. The CI pipeline should pass.

Manuel Tests

❯ uv run
Provide a command or script to invoke with `uv run <command>` or `uv run script.py`.

The following scripts are available:

normalizer
python
python3
python3.12

See `uv run --help` for more information.

@kakkoyun kakkoyun force-pushed the list_available_scripts_and_executables branch from 3b07e17 to e95ee42 Compare September 25, 2024 15:48
crates/uv/src/lib.rs Outdated Show resolved Hide resolved
@kakkoyun kakkoyun force-pushed the list_available_scripts_and_executables branch 2 times, most recently from 26a3552 to 3c1be57 Compare September 25, 2024 17:44
@kakkoyun kakkoyun marked this pull request as ready for review September 25, 2024 17:44
@kakkoyun kakkoyun force-pushed the list_available_scripts_and_executables branch from acc79e2 to 1c3691e Compare September 25, 2024 19:45
crates/uv/tests/run.rs Outdated Show resolved Hide resolved
crates/uv/tests/run.rs Outdated Show resolved Hide resolved
crates/uv/tests/run.rs Outdated Show resolved Hide resolved
crates/uv/tests/run.rs Outdated Show resolved Hide resolved
crates/uv/tests/run.rs Outdated Show resolved Hide resolved
@konstin konstin added the enhancement New feature or request label Sep 26, 2024
@kakkoyun kakkoyun force-pushed the list_available_scripts_and_executables branch 7 times, most recently from 86892f6 to 4c7f9bd Compare September 26, 2024 14:05
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kakkoyun kakkoyun force-pushed the list_available_scripts_and_executables branch from fa152ee to 1c89270 Compare September 27, 2024 16:55
@kakkoyun kakkoyun marked this pull request as ready for review September 27, 2024 16:56
@kakkoyun kakkoyun force-pushed the list_available_scripts_and_executables branch from 1c89270 to a07be21 Compare September 27, 2024 17:04
Signed-off-by: Kemal Akkoyun <[email protected]>
@kakkoyun kakkoyun force-pushed the list_available_scripts_and_executables branch from a07be21 to 30885bc Compare September 27, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv run and uv tool run should list available scripts and executables
3 participants