-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Enable EXE001 flake8 check. #27560
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
Enable EXE001 flake8 check. #27560
Conversation
According to pytorch#27285 , seems we do not intend to use shebang as an indication of Python version, thus we enable EXE001 flake8 check. For violations, we either remove shebang from non-executable Python scripts or grant them executable permission.
pietern
left a comment
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.
|
Sorry, there is some hidden back story here, which makes it a little tricky to do this. In Facebook internally, we have a lint check that essentially complains if you don't have Python 3 compatibility imports. There are a few ways to suppress it, but the one that is suggested by the linter is adding a shebang line to the top that explicitly says python3, even if the intent is never to actually run the file as an executable. Andres helpfully gave some more tips about the linter though:
I landed a PR that puts |
facebook-github-bot
left a comment
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.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Thanks for the explanation! |
Summary: According to pytorch#27285 , seems we do not intend to use shebang as an indication of Python version, thus we enable EXE001 flake8 check. For violations, we either remove shebang from non-executable Python scripts or grant them executable permission. Pull Request resolved: pytorch#27560 Differential Revision: D17831782 Pulled By: ezyang fbshipit-source-id: 6282fd3617b25676a6d959af0d318faf05c09b26
According to #27285 , seems we do not intend to use shebang as an indication of Python version, thus
we enable EXE001 flake8 check.
For violations, we either remove shebang from non-executable Python scripts or grant them executable permission.