feat: support third-party task registration via unilab.tasks entry-point group - #1501
Merged
Merged
Conversation
…ks entry-point group ensure_registries() now also collects bootstrap packages declared through the 'unilab.tasks' entry-point group, in addition to the built-in unilab.tasks package and the UNILAB_EXTRA_REGISTRY_PACKAGES env var (kept as the test-fixture/ad-hoc seam). Entry-point metadata lives in site-packages, so spawn-based collector subprocesses discover the same packages without env-var forwarding; entry-point import failures fail closed, unlike env-var packages. Closes the gap tracked in #1500 (roadmap #1252 item 4).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1500
范围(roadmap #1252 第 4 点)
第三方 task 包通过 Python package metadata 自动注册:声明
unilab.tasksentry-point group(value = 包名)即可被ensure_registries()自动发现并执行 package import,无需PYTHONPATH或UNILAB_TASK_PACKAGES。base/registry.py:ensure_registries()在 env var fallback 之后从unilab.tasksentry-point group 追加包名;entry-point 包保持 strict(导入失败即 raise,便于发现打包错误),env var 包维持 optional 语义。_REGISTERED_TASK_PACKAGES全兼容;entry-point 只做增量追加(已注册包去重)。1-architecture/5-registry.md运行时流程与扩展规则;3-extending/1-new_task.md实现清单补第三方包注册方式。Validation
最终 head
27ebee04本地make test-allPASS(exit 0):后续
microduck_rl_unilab / engineai_rl_unilab 声明各自
unilab.tasksentry point 后即可移除UNILAB_TASK_PACKAGES,作为本机制的首批 adoption 验收。