File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -70,20 +70,26 @@ df -h .
7070echo " ---- 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"
8081fi
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
8390import torchani
91+ print("pkg_resources:", pkg_resources.__name__)
8492print("torchani version:", torchani.__version__)
8593PYCODE
8694
87- $COMMAND_PKG deactivate
88-
8995echo " ✅ TANI environment '$ENV_NAME ' setup completed at $( date) "
Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ dependencies:
1818 - ipython
1919 - pyyaml
2020 - typing-extensions
21+ - setuptools
You can’t perform that action at this time.
0 commit comments