Skip to content

FIX Remove duplicate VBLoRAConfig entry from peft.__all__#3279

Open
SHAI-Akshay-Tripathi wants to merge 2 commits into
huggingface:mainfrom
SHAI-Akshay-Tripathi:fix-duplicate-vblora-config-in-all
Open

FIX Remove duplicate VBLoRAConfig entry from peft.__all__#3279
SHAI-Akshay-Tripathi wants to merge 2 commits into
huggingface:mainfrom
SHAI-Akshay-Tripathi:fix-duplicate-vblora-config-in-all

Conversation

@SHAI-Akshay-Tripathi

Copy link
Copy Markdown

Description

peft.__all__ listed "VBLoRAConfig" twice. 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.

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 the same regression recurring.
    • test_all_names_are_importable — verifies every name in __all__ is actually accessible on the package.

Verifying the regression test catches the bug

Per CONTRIBUTING.md, a bug fix should be accompanied by a test that fails on the broken code and passes on the fix:

  • On main without the __init__.py change: test_all_has_no_duplicates fails with AssertionError: Duplicate names in peft.__all__: {'VBLoRAConfig': 2}.
  • With the fix applied: both tests pass.

How to test

python -m pytest tests/test_public_api.py -v

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