Skip to content

Commit

Permalink
Try suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Dec 5, 2024
1 parent 75b07cd commit a5ffdfc
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,34 @@ jobs:
sudo apt update
sudo apt install -y mpich openmpi-bin libopenmpi-dev libmpich-dev
# choose available python versions from pyenv
pyenv_py_ver=""
case << parameters.NRN_PYTHON_VERSION >> in
39) pyenv_py_ver="3.9" ;;
310) pyenv_py_ver="3.10" ;;
311) pyenv_py_ver="3.11" ;;
312) pyenv_py_ver="3.12" ;;
313) pyenv_py_ver="3.13" ;;
*) echo "Error: pyenv python version not specified or not supported." && exit 1;;
esac
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $pyenv_py_ver --force
pyenv global $pyenv_py_ver
export PYTHON_EXE=$(which python)
# test wheel
packaging/python/test_wheels.sh $PYTHON_EXE $(ls -t wheelhouse/*.whl)
# use the desired python version from the docker image directly
echo "Using Python << parameters.NRN_PYTHON_VERSION >>"
# set python version using the correct docker image
if [ "<< parameters.NRN_PYTHON_VERSION >>" == "313" ]; then
docker run --rm -v $PWD:/mnt cimg/python:3.13.1 bash -c "
python --version;
# test wheel
packaging/python/test_wheels.sh $(which python) $(ls -t wheelhouse/*.whl)
"
else
# for older versions, fallback to pyenv approach
pyenv_py_ver=""
case << parameters.NRN_PYTHON_VERSION >> in
39) pyenv_py_ver="3.9" ;;
310) pyenv_py_ver="3.10" ;;
311) pyenv_py_ver="3.11" ;;
312) pyenv_py_ver="3.12" ;;
*) echo "Error: pyenv python version not specified or not supported." && exit 1;;
esac
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $pyenv_py_ver --force
pyenv global $pyenv_py_ver
export PYTHON_EXE=$(which python)
# test wheel
packaging/python/test_wheels.sh $PYTHON_EXE $(ls -t wheelhouse/*.whl)
fi
- run:
name: Upload nightly wheel to pypi.org
command: |
Expand Down

0 comments on commit a5ffdfc

Please sign in to comment.