korbit-ai[bot] commented on code in PR #34409:
URL: https://github.com/apache/superset/pull/34409#discussion_r2243555442


##########
.devcontainer/setup-dev.sh:
##########
@@ -21,6 +21,21 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
 echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
 echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc
 
+# Source the PATH update for the current session
+export PATH="$HOME/.cargo/bin:$PATH"
+
+# Create virtual environment using uv
+echo "🐍 Creating Python virtual environment..."
+uv venv
+
+# Install Python dependencies
+echo "📦 Installing Python dependencies..."
+uv pip install -r requirements/development.txt
+
+# Install pre-commit hooks
+echo "🪝 Installing pre-commit hooks..."
+source .venv/bin/activate && pre-commit install

Review Comment:
   ### Hardcoded venv path might not match uv's output <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The script assumes the virtual environment directory is named '.venv' but 
'uv venv' might create it with a different name or in a different location.
   
   
   ###### Why this matters
   If the virtual environment is created with a different name or location, the 
pre-commit hooks installation will fail, breaking the automated setup process.
   
   ###### Suggested change ∙ *Feature Preview*
   Query uv for the virtual environment path or verify its location before 
activation:
   ```bash
   # Get venv path from uv or use default
   VENV_PATH="$(uv venv --find 2>/dev/null || echo ".venv")"
   source "${VENV_PATH}/bin/activate" && pre-commit install
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/cc23b163-cee4-44c6-b0f6-aa0d0021b834/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/cc23b163-cee4-44c6-b0f6-aa0d0021b834?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/cc23b163-cee4-44c6-b0f6-aa0d0021b834?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/cc23b163-cee4-44c6-b0f6-aa0d0021b834?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/cc23b163-cee4-44c6-b0f6-aa0d0021b834)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:00513fbf-44f1-43ac-a11c-17000a82dcac -->
   
   
   [](00513fbf-44f1-43ac-a11c-17000a82dcac)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to