Skip to content

Commit 5483fa8

Browse files
authored
Fix .python-version lookup (#258)
Our selftest and Makefile happily find the .python-version in the working directory, but for actual users of the action it's not as easy: The .python-version is actually in the action path. Signed-off-by: Jussi Kukkonen <[email protected]>
1 parent f962baa commit 5483fa8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/selftest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
20-
python-version: ["3.x", "3.14"]
20+
python-version: ["3.x", "3.10", "3.14"]
2121
include:
2222
- os: ubuntu-latest
2323
python-version: platform-default

setup/create-venv.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ if [ -z "$1" ]; then
1212
fi
1313

1414
ENV=$1
15+
SCRIPT_DIR=$(dirname "$0")
16+
PYTHON_VERSION=$(cat "$SCRIPT_DIR/../.python-version")
1517

1618
BOOTSTRAP_ENV=$(mktemp -d)
1719
python3 -m venv --clear "$BOOTSTRAP_ENV"
@@ -24,6 +26,10 @@ else
2426
fi
2527

2628

27-
. "$BIN/activate" && pip install uv && uv venv --clear "$ENV" && VIRTUAL_ENV="$ENV" uv pip install uv
29+
. "$BIN/activate" && \
30+
pip install uv && \
31+
uv venv --python "$PYTHON_VERSION" --clear "$ENV" && \
32+
VIRTUAL_ENV="$ENV" uv pip install uv
33+
2834
touch "$ENV/bootstrap"
2935
rm -r "$BOOTSTRAP_ENV"

0 commit comments

Comments
 (0)