-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add pyproject.toml #690
Add pyproject.toml #690
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||||
[tool.black] | ||||||||
line-length = 119 | ||||||||
target-version = ['py37'] | ||||||||
|
||||||||
[tool.ruff] | ||||||||
ignore = ["C901", "E501", "E741", "W605"] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least in Accelerate, we never enforce
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit confused. You're suggesting to remove "E501" from the ignore list, so wouldn't it then be enforced? Accelerate includes it in the ignore list. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right! I misread, thanks |
||||||||
select = ["C", "E", "F", "I", "W"] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
line-length = 119 | ||||||||
|
||||||||
[tool.ruff.isort] | ||||||||
lines-after-imports = 2 | ||||||||
known-first-party = ["trl"] | ||||||||
|
||||||||
[isort] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assumed that it wouldn't sort work correctly with the line length without this block, but it seems to be fine! Removing |
||||||||
default_section = "FIRSTPARTY" | ||||||||
known_first_party = "trl" | ||||||||
known_third_party = [ | ||||||||
"numpy", | ||||||||
"torch", | ||||||||
"accelerate", | ||||||||
"transformers", | ||||||||
"peft", | ||||||||
] | ||||||||
line_length = 119 | ||||||||
lines_after_imports = 2 | ||||||||
multi_line_output = 3 | ||||||||
include_trailing_comma = true | ||||||||
force_grid_wrap = 0 | ||||||||
use_parentheses = true | ||||||||
ensure_newline_before_comments = true | ||||||||
|
||||||||
[tool.pytest] | ||||||||
doctest_optionflags = [ | ||||||||
"NORMALIZE_WHITESPACE", | ||||||||
"ELLIPSIS", | ||||||||
"NUMBER", | ||||||||
] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks a lot @muellerzr , indeed we do not test docstrings in our testing suite, so we can maybe safely remove that section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be
py38
as we recently dropped 3.7 support #441There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thanks for catching that