Skip to content

FIX Remove duplicate VBLoRAConfig entry from peft.__all__#2697

Open
SHAI-Akshay-Tripathi wants to merge 1 commit into
modelcontextprotocol:mainfrom
SHAI-Akshay-Tripathi:clean-up-call-tool-return-type
Open

FIX Remove duplicate VBLoRAConfig entry from peft.__all__#2697
SHAI-Akshay-Tripathi wants to merge 1 commit into
modelcontextprotocol:mainfrom
SHAI-Akshay-Tripathi:clean-up-call-tool-return-type

Conversation

@SHAI-Akshay-Tripathi
Copy link
Copy Markdown

Description

peft.__all__ listed "VBLoRAConfig" twice (lines 272-273 on main). Duplicate entries in __all__ silently confuse documentation tooling, IDE auto-import, and linters that rely on __all__ to determine the public API surface. It's the only duplicate among the 138 entries — looks like a copy-paste slip from a past edit.

Changes

  1. src/peft/__init__.py — remove the duplicate line.
  2. tests/test_public_api.py — new test file with two regression tests:
    • test_all_has_no_duplicates — guards against this kind of regression.
    • test_all_names_are_importable — verifies every name in __all__ is actually accessible on the package, catching stale or mistyped entries that would break from peft import *.

Verifying the regression test catches the bug

Per CONTRIBUTING.md, ideally a bug fix is accompanied by a test that fails on the broken code and passes on the fix. To confirm:

# On main, without the __init__.py change:
$ python -m pytest tests/test_public_api.py::TestPublicApi::test_all_has_no_duplicates -v
FAILED — AssertionError: Duplicate names in peft.__all__: {'VBLoRAConfig': 2}

# With the fix applied:
$ python -m pytest tests/test_public_api.py -v
PASSED  test_all_has_no_duplicates
PASSED  test_all_names_are_importable

How to test

python -m pytest tests/test_public_api.py -v
make quality

Both pass locally.

Refactor call_tool return type to include CallToolResult and tuple.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant