Skip to content

Commit a5ffdfc

Browse files
committed
Try suggestion
1 parent 75b07cd commit a5ffdfc

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

.circleci/config.yml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,34 @@ jobs:
4646
sudo apt update
4747
sudo apt install -y mpich openmpi-bin libopenmpi-dev libmpich-dev
4848
49-
# choose available python versions from pyenv
50-
pyenv_py_ver=""
51-
case << parameters.NRN_PYTHON_VERSION >> in
52-
39) pyenv_py_ver="3.9" ;;
53-
310) pyenv_py_ver="3.10" ;;
54-
311) pyenv_py_ver="3.11" ;;
55-
312) pyenv_py_ver="3.12" ;;
56-
313) pyenv_py_ver="3.13" ;;
57-
*) echo "Error: pyenv python version not specified or not supported." && exit 1;;
58-
esac
59-
60-
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $pyenv_py_ver --force
61-
pyenv global $pyenv_py_ver
62-
export PYTHON_EXE=$(which python)
63-
64-
# test wheel
65-
packaging/python/test_wheels.sh $PYTHON_EXE $(ls -t wheelhouse/*.whl)
66-
49+
# use the desired python version from the docker image directly
50+
echo "Using Python << parameters.NRN_PYTHON_VERSION >>"
51+
52+
# set python version using the correct docker image
53+
if [ "<< parameters.NRN_PYTHON_VERSION >>" == "313" ]; then
54+
docker run --rm -v $PWD:/mnt cimg/python:3.13.1 bash -c "
55+
python --version;
56+
# test wheel
57+
packaging/python/test_wheels.sh $(which python) $(ls -t wheelhouse/*.whl)
58+
"
59+
else
60+
# for older versions, fallback to pyenv approach
61+
pyenv_py_ver=""
62+
case << parameters.NRN_PYTHON_VERSION >> in
63+
39) pyenv_py_ver="3.9" ;;
64+
310) pyenv_py_ver="3.10" ;;
65+
311) pyenv_py_ver="3.11" ;;
66+
312) pyenv_py_ver="3.12" ;;
67+
*) echo "Error: pyenv python version not specified or not supported." && exit 1;;
68+
esac
69+
70+
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $pyenv_py_ver --force
71+
pyenv global $pyenv_py_ver
72+
export PYTHON_EXE=$(which python)
73+
74+
# test wheel
75+
packaging/python/test_wheels.sh $PYTHON_EXE $(ls -t wheelhouse/*.whl)
76+
fi
6777
- run:
6878
name: Upload nightly wheel to pypi.org
6979
command: |

0 commit comments

Comments
 (0)