build(test-queues-module-manual): Migrate to uv and pyproject.toml#45
Conversation
Replace pip/requirements.txt with uv/pyproject.toml. Update run.sh to use uv run. Refs PY-2472 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| [project] | ||
| name = "test-queues-module-manual" | ||
| version = "0" | ||
| requires-python = ">=3.12" |
There was a problem hiding this comment.
Bug: The pyproject.toml file's requires-python constraint (>=3.12) conflicts with the pinned version in .python-version (3.10.4), causing uv run to fail.
Severity: HIGH
Suggested Fix
Align the Python version requirements. Either update the .python-version file to a version that satisfies >=3.12, or change the requires-python setting in pyproject.toml to ">=3.10.4" to match the pinned version.
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-queues-module-manual/pyproject.toml#L4
Potential issue: The `pyproject.toml` file specifies `requires-python = ">=3.12"`, but
the project's `.python-version` file pins the Python interpreter to `3.10.4`. The `uv`
tool, used in `run.sh`, enforces that the environment's interpreter version satisfies
the `requires-python` constraint. When `uv run` is executed, it detects this version
mismatch and aborts with an incompatibility error, preventing the test script from
running.
Did we get this right? 👍 / 👎 to inform future reviews.
| if ! command -v uv &> /dev/null; then | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi | ||
|
|
||
| python main.py No newline at end of file | ||
| uv run python main.py |
There was a problem hiding this comment.
Bug: The script installs uv but fails to update the PATH in the current session, causing the subsequent uv command to fail.
Severity: HIGH
Suggested Fix
Explicitly update the PATH variable within the script after the installation step (e.g., export PATH="$HOME/.local/bin:$PATH") or invoke the uv binary using its absolute path.
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-queues-module-manual/run.sh#L5-L9
Potential issue: The `run.sh` script attempts to install `uv` if it is not found.
However, the installation process modifies shell configuration files for future sessions
but does not update the `PATH` environment variable for the current, executing shell.
Because the script uses `set -e`, the subsequent call to `uv run python main.py` fails
with a "command not found" error, causing the script to exit. This will occur in any
environment that does not already have `uv` installed and in the `PATH`.
Summary
Refs PY-2472
🤖 Generated with Claude Code