Skip to content

Commit 339afde

Browse files
OmkarSarkar204amilcarlucas
authored andcommitted
build(setup): automatically detect Python version for macOS
1 parent 6a604b5 commit 339afde

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

SetupDeveloperPC.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,19 @@ cd "$(dirname "$0")" || exit
2626
# Install macOS dependencies early if on macOS
2727
if command -v brew &> /dev/null; then
2828
echo "Installing macOS dependencies with Homebrew..."
29-
brew install uv python-tk@3.9
29+
30+
if command -v python3 &> /dev/null; then
31+
PY_VER=$(python3 --version | awk '{print $2}' | cut -d. -f1,2)
32+
else
33+
echo "Python not found."
34+
exit 1
35+
fi
36+
37+
echo "Found Python $PY_VER, installing python-tk..."
38+
brew install uv python-tk@"$PY_VER"
39+
3040
echo "Creating Python virtual environment with uv..."
31-
uv venv --python 3.9
41+
uv venv --python "$PY_VER"
3242
else
3343
# Create a local virtual environment if it doesn't exist
3444
if [ ! -d ".venv" ]; then

0 commit comments

Comments
 (0)