feat: separate out remaining dependencies and improve tests#789
feat: separate out remaining dependencies and improve tests#789jakelorocco merged 6 commits intomainfrom
Conversation
|
The PR description has been updated. Please fill out the template for your PR to be reviewed. |
dcc97f5 to
484a590
Compare
|
@frreiss, I believe you are getting pulled in just for the changes in mellea/formatters/granite/retrievers/util.py. This is a quality of life change but let me know if you see issues with it. Thanks! |
484a590 to
798ac76
Compare
There was a problem hiding this comment.
Tested the CLI install (following the original comments):
| Scenario | Result |
|---|---|
m (no extras) |
Friendly error: pip install "mellea[cli]" ✓ |
m --help with [cli] |
Works ✓ |
m serve script.py with [cli] only |
Friendly error: pip install "mellea[server]" ✓ |
m alora train ... with [cli] only |
Friendly error: pip install "mellea[hf]" ✓ |
m alora add-readme ... with [cli] only |
Raw ModuleNotFoundError: No module named 'huggingface_hub' ✗ |
This PR didn't touch the code in the last scenario - so opened as a followup #855
2237747 to
733cc0c
Compare
Signed-off-by: Jake LoRocco <jake.lorocco@ibm.com>
|
from copilot: CI is failing in Root cause: Somewhere in the RichDocument/docling initialization path, Fix: Cast from pathlib import Path
if model_root_dir is not None:
model_root_dir = str(Path(model_root_dir))
cfg_dict["Global"]["model_root_dir"] = model_root_dirIf there may be multiple Path values, defensively stringify paths recursively before calling from pathlib import Path
def _stringify_paths(obj):
if isinstance(obj, Path):
return str(obj)
if isinstance(obj, dict):
return {k: _stringify_paths(v) for k, v in obj.items()}
if isinstance(obj, list):
return [_stringify_paths(v) for v in obj]
return obj
cfg = OmegaConf.create(_stringify_paths(cfg_dict))This should unblock Failing test file reference: |
Signed-off-by: Jake LoRocco <jake.lorocco@ibm.com>
733cc0c to
5f61514
Compare
It's an issue with package dependency requirements. Docling requires both rapidocr and omegaconf. The newest version of rapidocr is incompatible with older versions of omegaconf (when running on linux). I was able to test and setting I'm not sure why only my PR seems to be hitting this issue though. I will see if the github action runners can succeed with this versioning change. |
not a ringing endorsement of the built-in "explain the error" functionality is it? 🤣 |
|
Unless there are objections before tomorrow 9:00am EST, I will force merge this PR. It requires reviews from two groups that are unlikely to give reviews (since I'm usually the one reviewing for them) due to small import changes (not functional changes). |
This actually came up in our sync this AM, we may want to reevaluate blocking merging of PRs in a whole dir of the project on just two reviewers, especially if those two are often the ones doing the work, thus making it block on one person in those cases. The easiest fix would be to expand those reviewer groups, the lazier version would be to disable blocking on sub teams and stick to main maintainers |
planetf1
left a comment
There was a problem hiding this comment.
LGTM for improving dependency tests
Signed-off-by: Jake LoRocco <jake.lorocco@ibm.com>
Misc PR
Type of PR
Description
We no longer need to explicitly version click. Typer is better about its click versioning in its own pyproject but the error is also gone.
Finishes up the dependency isolation tests; splits cli into it's own group; and fixes up import errors and dependency separation.
CI doesn't run the dependency isolation tests; ensured they pass locally.
All nice import error messages function like our current ones. The m cli works this way as well:
Testing