Skip to content

build(test-ray): Migrate from pip to uv#46

Merged
ericapisani merged 2 commits into
mainfrom
PY-2473-test-ray
May 21, 2026
Merged

build(test-ray): Migrate from pip to uv#46
ericapisani merged 2 commits into
mainfrom
PY-2473-test-ray

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace requirements.txt with pyproject.toml for dependency management
  • Update run.sh to use uv run instead of manual venv/pip workflow
  • Part of PY-2428 migration effort

Test plan

  • Run ./run.sh and verify the ray app starts correctly

🤖 Generated with Claude Code

Replace requirements.txt with pyproject.toml and update run.sh to use
uv for dependency management and script execution.

Refs PY-2473
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2473

PY-2428

Comment thread test-ray/pyproject.toml
[project]
name = "test-ray"
version = "0"
requires-python = ">=3.12"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The requires-python in pyproject.toml is set to >=3.12, but the .python-version file specifies 3.10, which will cause uv run to fail.
Severity: MEDIUM

Suggested Fix

Update the .python-version file in the test-ray/ directory to a version that satisfies the >=3.12 constraint specified in pyproject.toml, for example, by changing its content to 3.12.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-ray/pyproject.toml#L4

Potential issue: The `pyproject.toml` file specifies `requires-python = ">=3.12"`, while
the `.python-version` file in the same directory is set to `3.10`. When a tool like `uv`
is used, it will prioritize the version from `.python-version` (3.10). However, it will
then check this against the `requires-python` constraint from `pyproject.toml` and find
that 3.10 does not satisfy `>=3.12`. This incompatibility will cause the `uv run`
command to fail, preventing the test environment from being set up correctly.

Did we get this right? 👍 / 👎 to inform future reviews.

@ericapisani ericapisani merged commit f8eacbb into main May 21, 2026
8 checks passed
Comment thread test-ray/run.sh
Comment on lines +4 to +8
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

reset

# create and activate virtual environment
python -m venv .venv
source .venv/bin/activate

# Install (or update) requirements
python -m pip install -r requirements.txt

# Run ray app
python main.py No newline at end of file
uv run python main.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The script installs uv but doesn't update the current session's PATH, causing the subsequent uv run command to fail in environments where uv isn't pre-installed.
Severity: LOW

Suggested Fix

After installing uv, update the PATH for the current shell session before attempting to use the uv command. For example, add export PATH="$HOME/.local/bin:$PATH" after the curl installation line to ensure the uv executable can be found.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-ray/run.sh#L4-L8

Potential issue: The `run.sh` script installs `uv` via `curl` if it is not already
present, but then immediately attempts to execute it. The `uv` installer modifies shell
profile files (e.g., `.bashrc`) to add itself to the `PATH` for future sessions, but it
does not update the `PATH` for the current, running shell session. Consequently, in a
fresh environment where `uv` is not pre-installed, the subsequent `uv run` command will
fail with a "command not found" error. Because the script uses `set -euo pipefail`, this
error will cause the script to exit immediately.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9116f3e. Configure here.

Comment thread test-ray/.python-version
@@ -1 +1 @@
3.10
3.14

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Python 3.14 may break Ray due to known issues

Medium Severity

The .python-version jumps from 3.10 to 3.14, but Ray has a known open issue (ray-project/ray#62664, April 2026) where it fails to start on Python 3.14 due to a Pydantic dependency conflict. Since ray>=2.46.0 doesn't constrain the Pydantic version tightly enough, uv may resolve to an incompatible Pydantic, causing ray.init() to fail at runtime. This version jump is also not mentioned in the PR description, suggesting it may be unintentional.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9116f3e. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant