Skip to content

Commit cdb69b4

Browse files
committed
Bump setup-python to v6; improve python detection
Update GitHub Actions to use actions/setup-python@v6 in the workflow (added missing setup step and python --version checks). In linux/package-for-linux.sh, replace hard-coded build-path checks with command -v lookups: try python$PYTHON_VERSION_SHORT, then python3, then python. Use empty-string checks instead of -x and update the error message to indicate the host Python interpreter is missing for compileall. These changes make CI use the newer action and make runtime Python detection more robust across environments.
1 parent a52998c commit cdb69b4

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

.github/workflows/build-python-version.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
shell: bash
8080
run: |
8181
echo "PYTHON_VERSION_SHORT=$(echo "$PYTHON_VERSION" | cut -d. -f1,2)" >> "$GITHUB_ENV"
82-
- uses: actions/setup-python@v5
82+
- uses: actions/setup-python@v6
8383
with:
8484
python-version: ${{ env.PYTHON_VERSION }}
8585
- run: python --version
@@ -113,6 +113,10 @@ jobs:
113113
shell: bash
114114
run: |
115115
echo "PYTHON_VERSION_SHORT=$(echo "$PYTHON_VERSION" | cut -d. -f1,2)" >> "$GITHUB_ENV"
116+
- uses: actions/setup-python@v6
117+
with:
118+
python-version: ${{ env.PYTHON_VERSION }}
119+
- run: python --version
116120
- working-directory: linux
117121
shell: bash
118122
run: |

linux/package-for-linux.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ mkdir -p $PYTHON_ARCH/build
2121
tar zxvf $DIST_FILE -C $PYTHON_ARCH/build
2222

2323
# compile lib
24-
build_python="$PYTHON_ARCH/build/python/bin/python$PYTHON_VERSION_SHORT"
25-
if [ ! -x "$build_python" ]; then
26-
build_python="$PYTHON_ARCH/build/python/bin/python3"
24+
build_python=$(command -v "python$PYTHON_VERSION_SHORT" || true)
25+
if [ -z "$build_python" ]; then
26+
build_python=$(command -v python3 || true)
2727
fi
28-
if [ ! -x "$build_python" ]; then
29-
build_python="$PYTHON_ARCH/build/python/bin/python"
28+
if [ -z "$build_python" ]; then
29+
build_python=$(command -v python || true)
3030
fi
31-
if [ ! -x "$build_python" ]; then
32-
echo "Python interpreter not found in extracted runtime under $PYTHON_ARCH/build/python/bin"
31+
if [ -z "$build_python" ]; then
32+
echo "Host Python interpreter not found for compileall"
3333
exit 1
3434
fi
3535
"$build_python" -I -m compileall -b "$PYTHON_ARCH/build/python/lib/python$PYTHON_VERSION_SHORT"

0 commit comments

Comments
 (0)