Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mamba doesn't like name #2144

Merged
merged 3 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dependencies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Note all install methods after "main" take
<dask source="pip" pip_extra="[complete]"/>
<ray source="pip" pip_extra="[default]" os='mac,linux'>2.2</ray>
<ray source="pip" pip_extra="[default]" os='windows'>1.13</ray>
<pydantic source="pip">1</pydantic> <!-- ray 2.2 can't use pydantic 2 -->
<!-- redis is needed by ray, but on windows, this seems to need to be explicitly stated -->
<redis source="pip" os='windows'/>
<imageio>2.22</imageio>
Expand Down Expand Up @@ -99,4 +100,4 @@ Note all install methods after "main" take
<nomkl>remove</nomkl>
<numexpr>remove</numexpr>
</alternate>
</dependencies>
</dependencies>
6 changes: 4 additions & 2 deletions scripts/establish_conda_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,16 @@ function install_libraries()
then
# conda-forge
if [[ $ECE_VERBOSE == 0 ]]; then echo ... Installing libraries from conda-forge ...; fi
local COMMAND=`echo $($PYTHON_COMMAND ${RAVEN_LIB_HANDLER} ${INSTALL_OPTIONAL} ${OSOPTION} conda --action install --subset forge)`
if [[ $USE_MAMBA == TRUE ]]; then
conda install -n ${RAVEN_LIBS_NAME} -y -c conda-forge $MAMBA_ECE_ADD
local COMMAND=`echo $($PYTHON_COMMAND ${RAVEN_LIB_HANDLER} ${INSTALL_OPTIONAL} ${OSOPTION} conda --action install --subset forge --no-name)`
activate_env
local MCOMMAND=${COMMAND/#conda /mamba } #Replace conda at start with mamba
if [[ $ECE_VERBOSE == 0 ]]; then echo ... conda-forge command: ${MCOMMAND}; fi
${MCOMMAND}
else
local COMMAND=`echo $($PYTHON_COMMAND ${RAVEN_LIB_HANDLER} ${INSTALL_OPTIONAL} ${OSOPTION} conda --action install --subset forge)`

if [[ $ECE_VERBOSE == 0 ]]; then echo ... conda-forge command: ${COMMAND}; fi
${COMMAND}
fi
Expand Down Expand Up @@ -176,7 +178,7 @@ function create_libraries()
if [[ $USE_MAMBA == TRUE ]]; then
echo conda create -n ${RAVEN_LIBS_NAME} -y -c conda-forge mamba
conda create -n ${RAVEN_LIBS_NAME} -y -c conda-forge $MAMBA_ECE_ADD
local COMMAND=`echo $($WORKING_PYTHON_COMMAND ${RAVEN_LIB_HANDLER} ${INSTALL_OPTIONAL} ${OSOPTION} conda --action install --subset forge)`
local COMMAND=`echo $($WORKING_PYTHON_COMMAND ${RAVEN_LIB_HANDLER} ${INSTALL_OPTIONAL} ${OSOPTION} conda --action install --subset forge --no-name)`
activate_env
local MCOMMAND=${COMMAND/#conda /mamba }
if [[ $ECE_VERBOSE == 0 ]]; then echo ... conda-forge command: ${MCOMMAND}; fi
Expand Down
8 changes: 7 additions & 1 deletion scripts/library_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ def _readDependencies(initFile):
condaParser.add_argument('--subset', dest='subset',
choices=('core', 'forge', 'pip', 'pyomo'), default='core',
help='Use subset of installation libraries, divided by source.')
condaParser.add_argument('--no-name', dest='noName',
action='store_true',
help='Do not include --name in output (needed for mamba install)')

pipParser = subParsers.add_parser('pip', help='use pip as installer')
pipParser.add_argument('--action', dest='action', choices=('install', 'list', 'setup.cfg'), default='install',
Expand Down Expand Up @@ -596,7 +599,10 @@ def _readDependencies(initFile):
if args.installer == 'conda':
installer = 'conda'
equals = '='
actionArgs = '--name {env} -y {src}'
if args.noName:
actionArgs = '-y {src}'
else:
actionArgs = '--name {env} -y {src}'
# which part of the install are we doing?
if args.subset == 'core' or args.subset == 'forge':
# from defaults
Expand Down