Skip to content

build(test-llm-manual-instrumentation): Migrate to uv and pyproject.toml#36

Merged
ericapisani merged 1 commit into
mainfrom
PY-2463-test-llm-manual-instrumentation
May 21, 2026
Merged

build(test-llm-manual-instrumentation): Migrate to uv and pyproject.toml#36
ericapisani merged 1 commit into
mainfrom
PY-2463-test-llm-manual-instrumentation

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Summary

  • Replace pip/requirements.txt with uv/pyproject.toml for dependency management
  • Update run.sh to use uv run instead of manual venv creation and pip install
  • Remove legacy requirements.txt

Refs PY-2463

Test plan

  • Verify pyproject.toml includes all dependencies from the original requirements.txt
  • Verify run.sh uses uv run
  • Verify requirements.txt is removed

🤖 Generated with Claude Code

Replace pip/requirements.txt with uv/pyproject.toml for dependency
management. Update run.sh to use uv run instead of manual venv
creation and pip install.

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

linear-code Bot commented May 21, 2026

Copy link
Copy Markdown

PY-2463

Comment on lines +5 to +9
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

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 uv installer doesn't update the PATH for the current shell, causing the subsequent uv run command to fail with "command not found".
Severity: HIGH

Suggested Fix

After the uv installation command, source the appropriate environment file to update the PATH for the current session. For example, add source "$HOME/.cargo/env" immediately after the curl ... | sh line.

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-llm-manual-instrumentation/run.sh#L5-L9

Potential issue: The `run.sh` script installs `uv` using `curl ... | sh`. This
installation method modifies shell configuration files for future sessions but does not
add the `uv` executable to the `PATH` of the current shell session. Consequently, the
subsequent call to `uv run python main.py` fails with a "command not found" error.
Because the script is configured with `set -euo pipefail`, this error will cause the
script to exit immediately, preventing the test from running on any machine where `uv`
is not already installed.

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

[project]
name = "test-llm-manual-instrumentation"
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 pyproject.toml requires Python >=3.12, but the .python-version file pins 3.10.4, which will cause uv to fail due to a version mismatch.
Severity: HIGH

Suggested Fix

Align the Python version requirements across the project. Either update the .python-version file to a version that is >=3.12, or adjust the requires-python constraint in pyproject.toml to be compatible with 3.10.4.

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-llm-manual-instrumentation/pyproject.toml#L4

Potential issue: The newly added `pyproject.toml` file specifies a Python version
requirement of `requires-python = ">=3.12"`. However, the pre-existing `.python-version`
file in the repository pins the Python version to `3.10.4`. When `uv run` is executed,
it enforces version compatibility and will fail because the pinned version (`3.10.4`)
does not satisfy the new requirement. This conflict will prevent the test from running
in any environment that respects the `.python-version` file.

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

@ericapisani ericapisani merged commit 7beb92b into main May 21, 2026
11 checks passed
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