Skip to content

Commit bdce525

Browse files
Merge pull request #22 from AsymmetryChou/e3_para
Add environment checks for Torch and Scatter installation in ut.sh
2 parents dfee4c3 + 645d47f commit bdce525

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ut.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@
33
# This command ensures that the script will exit immediately if any command fails.
44
set -e
55

6+
echo "--- [ENV] Torch and Scatter ---"
7+
# 1. 打印 pip 识别到的安装信息和路径
8+
conda run -n dpnegf bash -c "pip show torch torch-scatter || true"
9+
# 2. 尝试直接 import 并打印底层版本,如果这里报错,说明 Docker 镜像本身就有问题
10+
conda run -n dpnegf bash -c "python -c \"import torch; print('Torch:', torch.__version__); import torch_scatter; print('Scatter:', torch_scatter.__version__)\" || echo '❌ Import 失败,镜像底层环境已损坏'"
11+
612
echo "--- Installing/updating package from PR in editable mode ---"
713

8-
# We use 'conda run' to execute the commands within the 'dpusk' environment.
14+
# We use 'conda run' to execute the commands within the 'dpnegf' environment.
915
# 1. `pip install -e .`: The '-e' (editable) flag is crucial. It installs the
1016
# package from the current directory (the PR's code) in a way that links
1117
# back to the source files. This ensures that the tests run against the
1218
# very latest code from the pull request, not the version baked into the
1319
# Docker image.
1420
# 2. `pytest ./tests/`: After the package is installed, we run the tests.
1521

16-
conda run -n dpnegf bash -c "pip install -e . && pytest dpnegf/tests/"
22+
conda run -n dpnegf bash -c "pip install --no-deps -e . && pytest dpnegf/tests/"
1723

1824
echo "--- Unit Tests Passed Successfully ---"
1925

0 commit comments

Comments
 (0)