Skip to content

FIX Remove duplicate VBLoRAConfig entry from peft.__all__#3279

Merged
githubnemo merged 4 commits into
huggingface:mainfrom
SHAI-Akshay-Tripathi:fix-duplicate-vblora-config-in-all
Jun 30, 2026
Merged

FIX Remove duplicate VBLoRAConfig entry from peft.__all__#3279
githubnemo merged 4 commits into
huggingface:mainfrom
SHAI-Akshay-Tripathi:fix-duplicate-vblora-config-in-all

Conversation

@SHAI-Akshay-Tripathi

@SHAI-Akshay-Tripathi SHAI-Akshay-Tripathi commented May 28, 2026

Copy link
Copy Markdown
Contributor

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 "VBLoRAConfig" entry.
  2. pyproject.toml — enable ruff's RUF068 (duplicate __all__ entries) in [tool.ruff.lint] extend-select, so the same regression is caught and auto-fixed by the linter going forward. (Per @githubnemo's review suggestion — preferable to a hand-written test since ruff detects and fixes this automatically.)

How to test

@githubnemo githubnemo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Indeed, this can be a problem. Instead of adding a unit test, let's add

    "RUF068", # Duplicates in __all__

to pyproject.toml in tool.ruff.lint.extend-select since ruff is able to detect and fix this automatically.

Comment thread tests/test_public_api.py Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — removed tests/test_public_api.py and added RUF068 to extend-select in pyproject.toml. Confirmed locally that ruff check flags and auto-fixes the duplicate, and formatting/linting pass clean. Agreed this is much cleaner than the manual test — thanks for the steer.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@githubnemo githubnemo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@githubnemo githubnemo merged commit cedea5b into huggingface:main Jun 30, 2026
10 checks passed
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.

3 participants