fix(dev): fix devcontainer LAMMPS pytest wrapper paths#5697
fix(dev): fix devcontainer LAMMPS pytest wrapper paths#5697wanghan-iapcm wants to merge 1 commit into
Conversation
The pytest LAMMPS wrappers computed SCRIPT_PATH as the parent of the repo
(dirname .../$0)/../..), while lmp/gdb_lmp and the devcontainer build
scripts use the .devcontainer directory itself. Since all wrappers derive
${SCRIPT_PATH}/../{libtorch,dp/lib,.venv} and the build scripts install
libtorch/dp/.venv at the repo root, the pytest wrappers resolved those two
directory levels too high, pointing LAMMPS_PLUGIN_PATH/LD_LIBRARY_PATH
outside the checkout.
Drop the extra /../.. so all four wrappers share the same base and resolve
to the repo root.
Fix deepmodeling#5691
📝 WalkthroughWalkthroughBoth devcontainer LAMMPS pytest wrapper scripts ( ChangesDevcontainer script path fix
Estimated code review effort: 1 (Trivial) | ~2 minutes Related issues: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5697 +/- ##
==========================================
- Coverage 81.97% 81.78% -0.20%
==========================================
Files 959 959
Lines 105748 105747 -1
Branches 4102 4102
==========================================
- Hits 86684 86481 -203
- Misses 17573 17770 +197
- Partials 1491 1496 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Problem
The devcontainer LAMMPS pytest wrappers compute
SCRIPT_PATHtwo directories above the wrapper script (SCRIPT_PATH=$(dirname $(realpath -s $0))/../..), while.devcontainer/lmp/gdb_lmpand all the devcontainer build scripts use the.devcontainerdirectory itself (SCRIPT_PATH=$(dirname $(realpath -s $0))). All wrappers then derive${SCRIPT_PATH}/../libtorch,${SCRIPT_PATH}/../dp/liband${SCRIPT_PATH}/../.venv. The build scripts installlibtorch,dp, and.venvat the repository root (download_libtorch.shunzips into${SCRIPT_PATH}/..,build_cxx.shinstalls to${SCRIPT_PATH}/../dp/,build_py.shrunsuv syncfrom${SCRIPT_PATH}/..). So the pytest wrappers' extra/../..resolves those paths two directory levels too high — pointingLAMMPS_PLUGIN_PATH/LD_LIBRARY_PATHoutside the checkout.Fix
Drop the
/../..from.devcontainer/pytest_lmpand.devcontainer/gdb_pytest_lmpso all four wrappers share the same base and resolve to the repository root, consistent with the build scripts.Scope / impact
These wrappers are interactive developer convenience scripts inside the devcontainer; CI does not invoke them (LAMMPS tests in CI set their own plugin and library paths). The bug therefore only affected a developer manually running
.devcontainer/pytest_lmpto debug LAMMPS tests, where the deepmd LAMMPS plugin would fail to load. There is nothing to unit-test here; the fix is verified by inspection — all four wrappers now use an identicalSCRIPT_PATHbase and identical${SCRIPT_PATH}/../…derivations.Fix #5691