Skip to content

Commit

Permalink
Streamlining Python Version Setup (idaholab#2215)
Browse files Browse the repository at this point in the history
* -Adds SET_PYTHON
* -Adds documentation for  --set-python
  • Loading branch information
aadeshINL authored and j-bryan committed Dec 13, 2023
1 parent 2dd0b85 commit ce5d602
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/establish_conda_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function install_libraries()
# conda-forge
if [[ $ECE_VERBOSE == 0 ]]; then echo ... Installing libraries from conda-forge ...; fi
if [[ $USE_MAMBA == TRUE ]]; then
local PRECOMMAND=`echo conda install -n ${RAVEN_LIBS_NAME} -y -c conda-forge $MAMBA_ECE_ADD`
local PRECOMMAND=`echo conda install -n ${RAVEN_LIBS_NAME} -y -c conda-forge $MAMBA_ECE_ADD $SET_PYTHON`
if [[ $ECE_VERBOSE == 0 ]]; then echo ... conda-forge pre-command: ${PRECOMMAND}; fi
${PRECOMMAND}
local COMMAND=`echo $($PYTHON_COMMAND ${RAVEN_LIB_HANDLER} ${INSTALL_OPTIONAL} ${OSOPTION} conda --action install --subset forge --no-name)`
Expand Down Expand Up @@ -178,7 +178,7 @@ function create_libraries()
echo ... temporarily using Python $WORKING_PYTHON_COMMAND for installation
fi
if [[ $USE_MAMBA == TRUE ]]; then
local PRECOMMAND=`echo conda create -n ${RAVEN_LIBS_NAME} -y -c conda-forge $MAMBA_ECE_ADD`
local PRECOMMAND=`echo conda create -n ${RAVEN_LIBS_NAME} -y -c conda-forge $MAMBA_ECE_ADD $SET_PYTHON`
if [[ $ECE_VERBOSE == 0 ]]; then echo ... conda-forge pre-command: $PRECOMMAND; fi
${PRECOMMAND}
local COMMAND=`echo $($WORKING_PYTHON_COMMAND ${RAVEN_LIB_HANDLER} ${INSTALL_OPTIONAL} ${OSOPTION} conda --action install --subset forge --no-name)`
Expand Down Expand Up @@ -277,6 +277,9 @@ function display_usage()
echo ' --quiet'
echo ' Runs script with minimal output'
echo ''
echo ' --set-python'
echo ' Set python version in mamba setup (only used if use mamba flag is true)'
echo ''
}

function activate_env()
Expand Down Expand Up @@ -391,6 +394,10 @@ do
--no-clean)
ECE_CLEAN=1
;;
--set-python)
shift
SET_PYTHON=$1
;;
esac
shift
done
Expand Down

0 comments on commit ce5d602

Please sign in to comment.