build(test-clickhouse-driver): Migrate to uv and pyproject.toml#10
Merged
Conversation
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-2438 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines
+4
to
+8
| if ! command -v uv &> /dev/null; then | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| fi | ||
|
|
||
| # create and activate virtual environment | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
|
|
||
| # Install (or update) requirements | ||
| python -m pip install -r requirements.txt | ||
|
|
||
|
|
||
| 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 doesn't update the PATH for the current shell session, causing the subsequent uv run command to fail.
Severity: HIGH
Suggested Fix
After installing uv, update the PATH for the current session before uv is called. For example, add export PATH="$HOME/.local/bin:$PATH" to the script. This ensures the uv binary is found and executed within the same script run.
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-clickhouse-driver/run.sh#L4-L8
Potential issue: The script installs the `uv` package if it is not found. However, the
installer adds the `uv` binary to a directory like `~/.local/bin` and updates shell
profile files for future sessions, but it does not modify the `PATH` of the current
running shell. Consequently, the subsequent command `uv run python main.py` will fail
with a 'command not found' error in any environment where `uv` was not previously
installed and in the `PATH`, such as a clean CI or Docker container.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pip/requirements.txtwithuv/pyproject.tomlfor dependency managementrun.shto useuv runinstead of manual venv creation and pip installrequirements.txtRefs PY-2438
Test plan
pyproject.tomlincludes all dependencies from the originalrequirements.txtrun.shusesuv runrequirements.txtis removed🤖 Generated with Claude Code