Skip to content

feat(pt_expt): load plugin entry points#5559

Merged
wanghan-iapcm merged 1 commit into
deepmodeling:masterfrom
njzjz-bothub:openclaw/pt-expt-plugin-loading
Jun 21, 2026
Merged

feat(pt_expt): load plugin entry points#5559
wanghan-iapcm merged 1 commit into
deepmodeling:masterfrom
njzjz-bothub:openclaw/pt-expt-plugin-loading

Conversation

@njzjz-bot

@njzjz-bot njzjz-bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • load the deepmd.pt_expt entry-point group when deepmd.pt_expt is imported
  • add a regression test that verifies pt_expt imports trigger plugin entry-point loading

Tests

  • uvx ruff check deepmd/pt_expt/__init__.py source/tests/pt_expt/test_plugin.py
  • python3 -m py_compile deepmd/pt_expt/__init__.py source/tests/pt_expt/test_plugin.py
  • lightweight import check with stubbed deepmd.utils.entry_point.load_entry_point

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5)

Summary by CodeRabbit

  • Tests

    • Added test to verify plugin entry point loading mechanism.
  • Chores

    • Implemented automatic plugin registration via entry points during module initialization.

Enable pt_expt plugins by loading the deepmd.pt_expt entry-point group when the package is imported.

Authored by OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.5)
@dosubot dosubot Bot added the new feature label Jun 19, 2026
@njzjz njzjz requested a review from wanghan-iapcm June 19, 2026 16:27
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a60b0b76-3734-413b-9ae2-87fa31355adc

📥 Commits

Reviewing files that changed from the base of the PR and between 1050e46 and 35396b7.

📒 Files selected for processing (2)
  • deepmd/pt_expt/__init__.py
  • source/tests/pt_expt/test_plugin.py

📝 Walkthrough

Walkthrough

deepmd/pt_expt/__init__.py is updated to import and immediately call load_entry_point("deepmd.pt_expt") at module import time. A new test file verifies this behavior by monkeypatching importlib.metadata.entry_points with a fake entry point and asserting the correct group is queried and load() is called once.

Changes

Plugin Entry-Point Loading

Layer / File(s) Summary
Entry-point invocation and unit test
deepmd/pt_expt/__init__.py, source/tests/pt_expt/test_plugin.py
__init__.py adds an import of load_entry_point and calls it with "deepmd.pt_expt" at import time. The new test file defines _FakeEntryPoint, monkeypatches importlib.metadata.entry_points, clears the module from sys.modules, re-imports it, and asserts the group name and that load() was called exactly once.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(pt_expt): load plugin entry points' directly and clearly summarizes the main change: adding functionality to load plugin entry points in the deepmd.pt_expt module upon import.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.16%. Comparing base (1050e46) to head (35396b7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5559   +/-   ##
=======================================
  Coverage   82.16%   82.16%           
=======================================
  Files         896      897    +1     
  Lines      102643   102646    +3     
  Branches     4340     4339    -1     
=======================================
+ Hits        84341    84344    +3     
- Misses      16965    16966    +1     
+ Partials     1337     1336    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Jun 21, 2026
Merged via the queue into deepmodeling:master with commit aae3485 Jun 21, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants