build(test-asyncio-taskgroup): Migrate from pip to uv#61
Conversation
Replace requirements.txt with pyproject.toml and update run.sh to use uv for dependency management and script execution. Refs PY-2430 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| if ! command -v uv &> /dev/null; then | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi | ||
|
|
There was a problem hiding this comment.
Bug: The run.sh script installs uv but doesn't update the current shell's PATH, causing the subsequent uv run command to fail with 'command not found'.
Severity: HIGH
Suggested Fix
After the uv installation line, add a command to update the PATH for the current session. For example, add export PATH="$HOME/.cargo/bin:$PATH" or source the appropriate shell configuration file.
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-asyncio-taskgroup/run.sh#L4-L7
Potential issue: The `run.sh` script installs `uv` via a curl pipe to `sh`. However, the
installer only modifies shell configuration files (like `.bashrc`) for future sessions
and does not update the `PATH` for the current, non-interactive shell session.
Consequently, the immediately following command, `uv run uvicorn main:app`, will fail
with a 'command not found' error on any system where `uv` is not already installed and
in the `PATH`.
Did we get this right? 👍 / 👎 to inform future reviews.
| [project] | ||
| name = "test-asyncio-taskgroup" | ||
| version = "0" | ||
| requires-python = ">=3.12" |
There was a problem hiding this comment.
Bug: The Python version in .python-version (3.11.11) conflicts with the requires-python = ">=3.12" constraint in pyproject.toml, causing uv run to fail.
Severity: HIGH
Suggested Fix
Align the Python versions. Either update the .python-version file to a version that satisfies >=3.12 (e.g., 3.12.0), or adjust the requires-python constraint in pyproject.toml to include 3.11.11.
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-asyncio-taskgroup/pyproject.toml#L4
Potential issue: The project configuration contains a Python version conflict. The
`.python-version` file pins the version to `3.11.11`, while the `pyproject.toml` file
specifies a requirement of `requires-python = ">=3.12"`. When `uv run` is executed, it
will respect the `.python-version` file, attempt to use Python 3.11.11, and then fail
with an incompatibility error because this version does not satisfy the `>=3.12`
constraint defined in `pyproject.toml`.
Did we get this right? 👍 / 👎 to inform future reviews.
Summary
requirements.txtwithpyproject.tomlfor dependency managementrun.shto useuv runinstead of manual venv/pip workflowTest plan
./run.shand verify the FastAPI app starts on port 5000🤖 Generated with Claude Code