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

Default to python when uv run does not recieve a command #3109

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Apr 17, 2024

This means that a bare uv run invocation drops you into a REPL.

This behavior is internally controversial, and may best be served by a dedicated uv repl command. I would imagine it's important to fail if no command is given in some circumstances, but those may be resolved by not doing this if we do not detect a TTY.

Regardless, I'm interested in giving this a try for a bit during this experimental phase.

@zanieb zanieb added internal A refactor or improvement that is not user-facing cli Related to the command line interface labels Apr 17, 2024
@zanieb zanieb force-pushed the zb/uv-run-python branch from e5f0c32 to db9246f Compare April 17, 2024 22:27
args: Vec<String>,
mut requirements: Vec<RequirementsSource>,
isolated: bool,
no_workspace: bool,
cache: &Cache,
printer: Printer,
) -> Result<ExitStatus> {
let command = target.unwrap_or("python".to_string());
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we could use the direct path to the Python in the virtual environment but that seems overkill to me?

@konstin
Copy link
Member

konstin commented Apr 18, 2024

The alternative is adding a tool.uv.default-run and use this instead of repl, with the python shim from rye creating a repl instead.

@zanieb zanieb force-pushed the zb/uv-run-no-workspace branch from a7c53f1 to 501719e Compare April 19, 2024 14:46
Base automatically changed from zb/uv-run-no-workspace to main April 19, 2024 14:52
@zanieb zanieb force-pushed the zb/uv-run-python branch from db9246f to 6f82f21 Compare April 19, 2024 15:05
@zanieb zanieb marked this pull request as ready for review April 19, 2024 15:06
@zanieb zanieb enabled auto-merge (squash) April 19, 2024 15:06
@zanieb zanieb merged commit 31765c0 into main Apr 19, 2024
38 checks passed
@zanieb zanieb deleted the zb/uv-run-python branch April 19, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants