Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AYou0207
Copy link

Description

The following demo breaks using current ray codebase.

uv init --package bugdemo && cd bugdemo && uv add ray && cat > src/bugdemo/main.py << EOF
import ray
def main():
    ray.init()
if __name__ == '__main__':
    main()
EOF && uv pip install -e . && uv run -m bugdemo.main

This PR fixes it.

Related issues

N/A

Signed-off-by: AYou0207 <[email protected]>
@AYou0207 AYou0207 requested a review from a team as a code owner December 19, 2025 04:16
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a bug in uv_runtime_env_hook.py that caused an AssertionError when uv run was used with options but no explicit command (e.g., uv run -m my_module). The change correctly adds a check to handle cases where the parsed command is an empty list. However, this fix appears to be incomplete as it introduces a subsequent issue on line 327, where uv_run_args is incorrectly assigned an empty list when command is empty. This leads to py_executable in the runtime environment being set to an empty string. I've added a specific comment with suggestions on how to address this. I also left a comment to improve the clarity of the code comment that was added.

Signed-off-by: AYou0207 <[email protected]>
Signed-off-by: AYou0207 <[email protected]>
@ray-gardener ray-gardener bot added core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Dec 19, 2025
@codope codope added the go add ONLY when ready to merge, run all tests label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants