Skip to content

Commit f640623

Browse files
committed
Fix Python version for sigstore signing on CentOS 7 builds
The sigstore action requires Python 3.9+ and looks for 'python' (not 'python3'). On CentOS 7 (vfx2021 and vfx2022), the system Python is 3.7.9, so we use uv to install Python 3.11. Previously, uv only created a python3.11 symlink in ~/.local/bin, which caused sigstore to fall back to system Python 3.7.9 and fail. Changes: - Extend uv Python setup to both vfx2021 and vfx2022 (both CentOS 7) - Use 'uv python install --default' to create python, python3, and python3.11 symlinks in ~/.local/bin - Simplify PATH setup to just add ~/.local/bin This ensures the sigstore action finds Python 3.11 as 'python'. Signed-off-by: Gary Oberbrunner <[email protected]>
1 parent 2dfdaee commit f640623

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -199,32 +199,26 @@ jobs:
199199
# Unfortunately astral-sh/setup-uv action doesn't work on CentOS 7, its GLIBC is too old.
200200

201201
- name: Set up uv manually
202-
if: matrix.release_prefix == 'linux-vfx2021'
202+
if: matrix.vfx-cy == 2021 || matrix.vfx-cy == 2022
203203
run: |
204204
curl -LsSf https://astral.sh/uv/install.sh | sh
205205
source ~/.local/bin/env
206-
echo After sourcing uv env: "$PATH"
207-
uv python install --preview 3.11
208-
209-
# Python is in $(uv python dir)/cpython-*/bin
210-
# uv also installs a symlink in $HOME/.local/bin but because
211-
# that is only a symlink, it causes problems with pip and venv.
212-
# As a workaround, prepend the actual bin dir to $PATH.
213-
uv_python_dir="$(uv python dir)"
214-
uv_cpython_name="$(/bin/ls -1 $uv_python_dir)"
215-
uv_python_path="$uv_python_dir/$uv_cpython_name/bin"
216-
PATH="$uv_python_path":$PATH
217-
# Prepend to path for future steps (note: don't use $GITHUB_ENV here)
218-
echo "$uv_python_path" >> $GITHUB_PATH
206+
echo "After sourcing uv env, PATH=$PATH"
207+
208+
# Use --default to create python/python3 symlinks in ~/.local/bin
209+
# This ensures the sigstore action can find 'python' (not just 'python3')
210+
uv python install --default 3.11
211+
212+
# Add ~/.local/bin to PATH for future steps
213+
echo "$HOME/.local/bin" >> $GITHUB_PATH
219214
220215
- name: Check python, uv paths
221216
run: |
222-
echo $PATH
223-
echo -n 'which python: ' && which python
224-
echo -n 'which python3: ' && which python3
225-
echo -n 'python version: ' && python --version
226-
echo -n 'python3 version: ' && python3 --version
227-
echo -n 'which uv: ' && (which uv || echo "No python uv; continuing")
217+
echo "PATH=$PATH"
218+
echo -n 'which python: ' && which python && python --version
219+
echo -n 'which python3: ' && which python3 && python3 --version
220+
echo -n 'python symlink target: ' && (readlink -f $(which python) || echo "not a symlink")
221+
echo -n 'which uv: ' && (which uv || echo "No uv; continuing")
228222
229223
- name: Install Conan
230224
id: conan

0 commit comments

Comments
 (0)