8000 MAINT apply sorting of exported symbols in `__all__` by bluenote10 · Pull Request #2280 · huggingface/peft · GitHub
[go: up one dir, main page]

Skip to content

MAINT apply sorting of exported symbols in __all__ #2280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bluenote10
Copy link
Contributor

This is the other follow-up discussed in #2265. It enables ruff rule RUF022 to enable automatic sorting of symbols in __all__.

Note that peft currently uses a slightly outdated version of ruff: The pinning uses ruff~=0.6.1, which means that one currently gets 0.6.9. The current version of ruff is 0.8.3. The rule RUF022 has still been a preview rule in 0.6.9, but in 0.8.3 is has went from preview to a standard rule, as visible from this list. To allow using RUF022 I had to enable preview mode. I decided to combine it with explicit-preview-rules, which means that preview rules within a group should require explicit enabling/selecting.

Regarding suppressing rule F841 (unused variable): I assume that this rule also was only in preview in 0.6.9, whereas it is stable now as well. For some reason explicit-preview-rules didn't really do its job properly in this case, because F841 is not explicitly listed in extend-select, and yet ruff started to complain about unused variables now. For now I decided to add it to the ignore list.

I also got one new lint for C419 (unnecessary list comprehension), which I simply solved by converting it locally to a generator expression as intended by the lint.

@HuggingFaceDocBuilderDev

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.

Copy link
Member
@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for applying the sorting rule for __all__, changes LGTM. (Failing tests are unrelated)

@BenjaminBossan BenjaminBossan merged commit 8bafdb1 into huggingface:main Dec 13, 2024
13 of 14 checks passed
Guy-Bilitski pushed a commit to Guy-Bilitski/peft that referenced this pull request May 13, 2025
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
0