Repository navigation
Conversation
camel.utils.__all__ advertised generate_prompt_for_structured_output without importing it from .commons, and camel.datagen.evol_instruct.__all__ advertised MathEvolInstructTemplates without importing it from .templates; both raise at import time (ImportError on direct import, AttributeError on star import, since star imports resolve __all__ entries with getattr). Add the two missing imports and extend test/test_all_exports.py (which previously pinned only the root package) with star-import resolution checks for both submodules. AI assistance disclosure: diagnosis, patch and regression tests were produced with an AI coding assistant; the author reviewed and verified every line and reproduced the failures on camel-ai==0.2.90 from PyPI.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
Convenience note for whoever reviews this, because the check list reads worse than the diff. All 6 red checks on this head are structural to fork PRs and cannot be turned green from the author side. I confirmed this from the job logs and annotations rather than guessing: 5 × 1 × So the signal that actually describes this change is the 7 green checks; the 6 red ones are the environment. If there is a preferred way to get a real For the record, the diff is two import lines plus a test: |
Closes #4402
Description
Two names advertised in submodule
__all__lists could not be resolved at import time:/n/n-camel.datagen.evol_instruct.__all__advertisedMathEvolInstructTemplates(defined intemplates.py) without importing it —from camel.datagen.evol_instruct import *raisedAttributeError, direct import raisedImportError.camel.utils.__all__advertisedgenerate_prompt_for_structured_output(defined inutils/commons.py) without including it in thefrom .commons import (...)block — direct import raisedImportError.__all__is a runtime contract (star imports resolve every entry withgetattr), so both failures hit callers directly. Confirmed oncamel-ai==0.2.90from PyPI.This PR adds the two missing imports and extends
test/test_all_exports.py— which previously pinned only the root package — with star-import resolution checks for both submodules, so the same regression class cannot silently return.Note: the phantom
DescriptionVideoPromptTemplateDictentry incamel.prompts.__all__is intentionally not touched here, as it is already covered by #3810.What is the purpose of this pull request?
Verification
Red (before,
camel-ai==0.2.90PyPI wheel, Python 3.11.8):Green (this branch, installed into the same environment):
The two new tests cover both submodules; the two pre-existing tests in the file keep passing.
Checklist
pyproject.tomland runuv lock— no dependency changesAI assistance disclosure
Tool(s) used: AI coding assistant (agentic coding session).
How you used it: The assistant located the two defects via a static
__all__audit, produced the two import additions and the regression tests, and ran the red/green verification shown above against the PyPI wheel. I have read and understand every line of the change, reproduced both failures independently, and take full responsibility for the diff.