Skip to content

Commit a033397

Browse files
committed
Adds setuptools as a dependency
Includes setuptools as a dependency in the environment file. This ensures that the package installation process has access to required tools and resources.
1 parent c6df19e commit a033397

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

devtools/install_torchani.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,26 @@ df -h .
7070
echo "---- Conda env list ----"
7171
$COMMAND_PKG env list
7272

73-
# 10) Activate and sanity-check
74-
echo ">>> Activating and sanity-checking TANI import"
75-
set +x
76-
if [[ $COMMAND_PKG == micromamba ]]; then
77-
micromamba activate "$ENV_NAME"
78-
else
79-
conda activate "$ENV_NAME"
73+
# 10) Ensure pkg_resources exists, then sanity-check import without shell activation
74+
echo ">>> Ensuring setuptools/pkg_resources is present in '$ENV_NAME'"
75+
$COMMAND_PKG install -n "$ENV_NAME" -y setuptools
76+
77+
echo ">>> Verifying pkg_resources in '$ENV_NAME'"
78+
if ! $COMMAND_PKG run -n "$ENV_NAME" python -c "import pkg_resources" >/dev/null 2>&1; then
79+
echo ">>> pkg_resources missing after conda install; forcing setuptools reinstall via pip"
80+
$COMMAND_PKG run -n "$ENV_NAME" python -m pip install --upgrade --force-reinstall "setuptools<81"
8081
fi
8182

82-
python - <<'PYCODE'
83+
# Hard fail early if pkg_resources is still unavailable.
84+
$COMMAND_PKG run -n "$ENV_NAME" python -c "import pkg_resources"
85+
86+
echo ">>> Sanity-checking TANI import"
87+
set +x
88+
$COMMAND_PKG run -n "$ENV_NAME" python - <<'PYCODE'
89+
import pkg_resources
8390
import torchani
91+
print("pkg_resources:", pkg_resources.__name__)
8492
print("torchani version:", torchani.__version__)
8593
PYCODE
8694

87-
$COMMAND_PKG deactivate
88-
8995
echo "✅ TANI environment '$ENV_NAME' setup completed at $(date)"

devtools/tani_environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ dependencies:
1818
- ipython
1919
- pyyaml
2020
- typing-extensions
21+
- setuptools

0 commit comments

Comments
 (0)