Skip to content

Commit 92d1574

Browse files
committed
added option to use micromamba and mamba install
1 parent 32aba20 commit 92d1574

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

fdog/setupfDog.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,23 @@ def main():
262262
if check_conda_env() == True:
263263
req_file = '%s/data/conda_requirements.yml' % fdogPath
264264
print('=> Dependencies in %s' % req_file)
265+
micromamba_install_cmd = 'micromamba install -c bioconda --file %s -y' % (req_file)
266+
mamba_install_cmd = 'mamba install -c bioconda --file %s -y' % (req_file)
265267
conda_install_cmd = 'conda install -c bioconda --file %s -y' % (req_file)
266268
try:
267-
subprocess.call([conda_install_cmd], shell = True)
268-
except:
269-
sys.exit('\033[91mERROR: Cannot install conda packages in %s!\033[0m' % req_file)
269+
# Try to use micromamba first
270+
subprocess.check_call(micromamba_install_cmd, shell=True)
271+
except subprocess.CalledProcessError as e:
272+
try:
273+
# If micromamba fails, try mamba
274+
subprocess.check_call(mamba_install_cmd, shell=True)
275+
except subprocess.CalledProcessError as e:
276+
try:
277+
# If both fail, try conda
278+
subprocess.check_call(conda_install_cmd, shell=True)
279+
except subprocess.CalledProcessError as e:
280+
# If all installation attempts fail, exit with an error message
281+
sys.exit('\033[91mERROR: Cannot install conda packages in %s!\033[0m' % req_file)
270282
else:
271283
install_cmd = 'sudo apt-get install -y -qq <tool>'
272284
sys.exit('\033[91mERROR: Please install these tools manually:\n%s\nusing the command: %s!\033[0m' % (', '.join(missing_tools), install_cmd))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name="fdog",
29-
version="0.1.38",
29+
version="0.1.39",
3030
python_requires='>=3.12.0',
3131
description="Feature-aware Directed OrtholoG search tool",
3232
long_description=long_description,

0 commit comments

Comments
 (0)