Skip to content

Commit ac1f9ef

Browse files
committed
FIX: Py ver
1 parent d7d6847 commit ac1f9ef

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
**/pylock.ci-old.toml
148148
python-version: ${{ matrix.python }}
149149
if: matrix.kind == 'old'
150-
- run: bash ./tools/github_actions_verify_python.sh
150+
- run: bash ./tools/github_actions_verify_python.sh "${{ matrix.python }}"
151151
- run: bash ./tools/github_actions_dependencies.sh
152152
- run: python ./tools/github_actions_check_old_env.py
153153
if: matrix.kind == 'old'

tools/github_actions_verify_python.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22

33
set -eo pipefail
44

5+
WANT_PYTHON_VERSION="$1"
6+
if [[ -z "$WANT_PYTHON_VERSION" ]]; then
7+
echo "✕ ERROR: Missing required argument: want Python version (e.g., 3.10)"
8+
exit 1
9+
fi
10+
511
GOT_PYTHON=$(which python)
12+
GOT_PYTHON_VERSION=$(python --version)
613
echo "Checking Python found at:"
7-
echo " \$(which python) == ${GOT_PYTHON}"
14+
echo " \$(which python) == ${GOT_PYTHON}"
15+
echo " \$(python --version) == ${GOT_PYTHON_VERSION}"
816
echo "for"
9-
echo " \$MNE_CI_KIND == ${MNE_CI_KIND}"
17+
echo " \$MNE_CI_KIND == ${MNE_CI_KIND}"
1018
if [[ "${MNE_CI_KIND}" == "conda" ]] || [[ "${MNE_CI_KIND}" == "mamba" ]]; then
1119
WANT="micromamba/envs/mne"
1220
elif [[ "${MNE_CI_KIND}" == "old" ]]; then
@@ -24,3 +32,9 @@ if [[ "${GOT_PYTHON}" != *"${WANT}"* ]]; then
2432
else
2533
echo "☑ Found expected \"${WANT}\""
2634
fi
35+
if [[ "${GOT_PYTHON_VERSION}" != *"${WANT_PYTHON_VERSION}"* ]]; then
36+
echo "✕ ERROR: Did not find expected Python version \"${WANT_PYTHON_VERSION}\""
37+
exit 1
38+
else
39+
echo "☑ Found expected Python version \"${WANT_PYTHON_VERSION}\""
40+
fi

0 commit comments

Comments
 (0)