Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 4840abe

Browse files
authored
provide qualified exe paths to CmdAction (#88)
1 parent 8633787 commit 4840abe

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pyctdev/_conda.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import glob
3131
import json
3232
import re
33+
import shlex
34+
import shutil
3335
import sys
3436
import warnings
3537
try:
@@ -174,8 +176,13 @@ def _conda_install_with_options(options,channel,env_name_again,no_pin_deps,all_e
174176
deps = " ".join('"%s"'%dep for dep in deps)
175177
# TODO and join the club?
176178
e = '' if env_name_again=='' else '-n %s'%env_name_again
177-
cmd = "%s install -y " % (conda_mode) + e + " %s %s" % (" ".join(['-c %s' % c for c in channel]), deps)
179+
if conda_mode == 'mamba':
180+
bin_path = shutil.which('mamba')
181+
else:
182+
bin_path = CONDA_ROOT_EXE
183+
cmd = "%s install -y " % (bin_path) + e + " %s %s" % (" ".join(['-c %s' % c for c in channel]), deps)
178184
print('Install runtime dependencies with:', cmd)
185+
cmd = shlex.split(cmd)
179186
return cmd
180187
else:
181188
return echo("Skipping conda install (no dependencies)")
@@ -882,7 +889,7 @@ def task_develop_install():
882889
883890
"""
884891
return {'actions': [
885-
CmdAction(_conda_build_deps, shell=False),
892+
CmdAction(_conda_build_deps),
886893
CmdAction(_conda_install_with_options_hacked, shell=False),
887894
python_develop],
888895
'params': [_options_param,_channel_param,no_pin_deps,_all_extras_param,_conda_mode_param]}

0 commit comments

Comments
 (0)