Repository navigation
Conversation
The option was declared and documented but never read: the generated README is identical with or without it, and a non-existent path was silently accepted. Deprecate it rather than remove it so scripts that followed the published examples keep working: the help text and docstring now mark it deprecated, and passing a value prints a warning that it is ignored and will be removed in a future release. The flag is also dropped from the add-readme examples in docs/examples/aLora/README.md. Fixes generative-computing#1860 Assisted-by: Devin Signed-off-by: Seyamalam <[email protected]>
planetf1
left a comment
There was a problem hiding this comment.
Approving. This is the right size for #1860: the examples and CLI reference told people to pass a flag that did nothing, and now they don't, while existing scripts keep working.
I ran the real CLI with the Hub and README generator stubbed. --io-yaml /definitely/not/here.yaml exits 0 and prints the warning before generation starts, and without the flag there's no warning. Help text and docstring agree. The upload --intrinsic examples correctly keep --io-yaml. test/cli/test_alora_upload.py passes with huggingface_hub installed (9 passed). I also disabled the warning locally and the new test failed, so it does check the warning.
Two optional test additions, neither needed to merge:
- The test calls
alora_add_readme(...)directly, so it doesn't check that the flag still parses. If someone later removed thetyper.Option, it would still pass whilem alora add-readme --io-yaml xstarted failing with "No such option". ACliRunnerinvocation would cover that. - Nothing checks that the warning is absent when the flag isn't passed, so an unconditional warning would also pass. One
capsysassertion on theio_yaml=Nonecase would cover it.
Smaller: the new strings use an em dash, which the other help text in this file doesn't, and the test sits in a file whose docstring is about token lookup.
Separately, the generated README still doesn't use the adapter's real contract. The template calls get_io_contract(name), which falls back to a permissive contract for adapters outside the catalogue. I've opened #1866 to build the README from the real io.yaml, so this PR can stay a consistency fix.
|
Have just kicked off the workflows. Let me know if you want to make any further changes - optional. If not, I can merge. |
ajbozarth
left a comment
There was a problem hiding this comment.
Some feedback from Claude: LGTM, and I agree with the follow-up review's optional test suggestions. One small optional nit inline.
|
|
||
|
|
||
| def test_add_readme_io_yaml_warns_it_is_ignored(monkeypatch, capsys): | ||
| """--io-yaml is deprecated in add-readme: it warns and is not forwarded (#1860).""" |
There was a problem hiding this comment.
Nit (optional): drop the (#1860) from the docstring. None of the other tests here cite an issue, and the PR already records the link.
Pull Request
Thanks for sending a pull request! Please make sure you read the contributing guidelines.
Issue
Fixes #1860
Description
m alora add-readmedeclared--io-yamland documented it, but never read the value —generate_readmehas no parameter for it, so the README was identical with or without the flag and a non-existent path was accepted silently.This takes the deprecation route from the issue (option 2): the option still parses so scripts that followed the published examples keep working, but the help text and docstring mark it deprecated, and passing a value prints a stderr warning that it is ignored and will be removed in a future release. The
--io-yamlflag is also dropped from the twoadd-readmeexamples indocs/examples/aLora/README.md(theupload --intrinsicexamples keep it — that command consumes the file).Testing
Attribution
Adding a new component, requirement, sampling strategy, or tool?
If your PR adds or modifies one of the types below, check the matching box. A checklist of type-specific review items will be posted as a comment.
NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.