From 477bcafeb0b17b8a56ab4b0b0a9169ca58046e5f Mon Sep 17 00:00:00 2001 From: Anthony Samms Date: Mon, 27 Oct 2025 19:22:26 -0400 Subject: [PATCH] Update python-app.yml --- .github/workflows/python-app.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index c1c8e18..17b49f4 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -230,18 +230,34 @@ jobs: run: | echo "=== Building Pillow from source ===" - # Get the Windows Python path from uv - PYTHON_PATH=$(cygpath -u "$(/c/hostedtoolcache/windows/uv/*/x64/uv.exe python dir)") - PYTHON_EXE="$PYTHON_PATH/python.exe" + # Find uv in Windows PATH + UV_PATH=$(where.exe uv.exe | head -n1) + echo "UV found at: $UV_PATH" + # Get the Python directory from uv + PYTHON_DIR=$("$UV_PATH" python dir 2>/dev/null || echo "") + + if [ -z "$PYTHON_DIR" ]; then + echo "Trying alternative method to find Python..." + # Alternative: check common uv Python locations + PYTHON_DIR=$(find /c/Users/*/AppData/Roaming/uv/python -name "cpython-*-windows-*" -type d 2>/dev/null | head -n1) + fi + + PYTHON_EXE="$PYTHON_DIR/python.exe" + echo "Python directory: $PYTHON_DIR" echo "Python executable: $PYTHON_EXE" + if [ ! -f "$PYTHON_EXE" ]; then + echo "Error: Python executable not found at $PYTHON_EXE" + exit 1 + fi + # Set up build environment with MSYS2 paths export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig" export CFLAGS="-I/mingw64/include" export LDFLAGS="-L/mingw64/lib" - # Build Pillow using MSYS2's Python pip with the Windows Python + # Build Pillow using the Windows Python "$PYTHON_EXE" -m pip install --no-binary pillow pillow echo "=== Pillow build completed ==="