Skip to content

Commit 96f5a1e

Browse files
committed
Refactor installation process to add 'install-ci' target and improve environment handling in RMG-Py installer
1 parent 5d0eb93 commit 96f5a1e

3 files changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ jobs:
6565
key: ${{ runner.os }}-rmgpy-${{ hashFiles('ARC/devtools/install_rmg.sh') }}
6666
restore-keys: ${{ runner.os }}-rmgpy-
6767

68-
- name: Install all extras
68+
- name: Install all extras - CI
6969
shell: micromamba-shell {0}
7070
working-directory: ARC
71-
run: bash devtools/install_all.sh --no-clean
71+
run: make install-ci
7272

7373
- name: Run Unit Tests
7474
shell: micromamba-shell {0}

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
DEVTOOLS_DIR := devtools
88

99
.PHONY: all help clean test test-unittests test-functional test-all \
10-
install-all install-molecule install-rmgdb install-autotst install-gcn \
10+
install-all install-ci install-molecule install-rmgdb install-autotst install-gcn \
1111
install-gcn-cpu install-kinbot install-sella install-xtb install-torchani install-ob \
1212
lite check-env compile
1313

@@ -25,6 +25,7 @@ help:
2525
@echo ""
2626
@echo "Installation:"
2727
@echo " install Install all external dependencies"
28+
@echo " install-ci Install all external dependencies for CI (no clean)"
2829
@echo " install-molecule Install molecule"
2930
@echo " install-rmgdb Install RMG-database"
3031
@echo " install-autotst Install AutoTST"
@@ -62,6 +63,10 @@ install:
6263
@echo "Installing all external ARC dependencies..."
6364
bash $(DEVTOOLS_DIR)/install_all.sh
6465

66+
install-ci:
67+
@echo "Installing all external ARC dependencies for CI (no clean)..."
68+
bash $(DEVTOOLS_DIR)/install_all.sh --no-clean
69+
6570
install-molecule:
6671
bash $(DEVTOOLS_DIR)/install_molecule.sh
6772

devtools/install_rmg.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,26 @@ export RMG_PY_PATH="$(realpath RMG-Py)"
6262
export RMG_DB_PATH="$(realpath RMG-database)"
6363

6464
###############################################################################
65-
# CREATE ENVIRONMENT
65+
# CREATE OR UPDATE rmg_env
6666
###############################################################################
6767
cd "$RMG_PY_PATH"
68-
echo "📚 Creating conda env: $ENV_NAME"
69-
$COMMAND env create -n "$ENV_NAME" -f environment.yml || {
70-
echo "⚠️ Environment likely exists; trying update..."
68+
echo "📚 Ensuring conda env: $ENV_NAME"
69+
70+
if $COMMAND env list | grep -qE "^$ENV_NAME\s"; then
71+
echo "📦 Updating existing env…"
7172
if [[ "$COMMAND" == micromamba ]]; then
72-
micromamba env update -n "$ENV_NAME" --file environment.yml
73+
$COMMAND env update -n "$ENV_NAME" --file environment.yml
7374
else
7475
$COMMAND env update -n "$ENV_NAME" -f environment.yml
7576
fi
76-
}
77+
else
78+
echo "📦 Creating env from scratch…"
79+
if [[ "$COMMAND" == micromamba ]]; then
80+
$COMMAND env create -n "$ENV_NAME" --file environment.yml
81+
else
82+
$COMMAND env create -n "$ENV_NAME" -f environment.yml
83+
fi
84+
fi
7785

7886
###############################################################################
7987
# COMPILE RMG

0 commit comments

Comments
 (0)