Skip to content

Conversation

@vincentqb
Copy link
Contributor

@vincentqb vincentqb commented Nov 20, 2020

cc #1048

(Out of scope for this PR: the lint test should pick unused dependencies where relevant and possible.)

Copy link
Contributor

@mthrok mthrok left a comment

Choose a reason for hiding this comment

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

Looks good, as long as tests pass

@vincentqb vincentqb merged commit e121022 into pytorch:master Nov 20, 2020
@mthrok
Copy link
Contributor

mthrok commented Nov 20, 2020

To enable linting for unused imports, F401 has to be removed from tox.ini.

But this is not perfect as it will also enable the warnings to __init__.py.
To workaround,

  1. one has to define __all__ in __init__.py, or
  2. add #noqa: F401 to each import

I think these workaround requires a little bit of work at the beginning but is well justified and enforces a good practice.

BTW I do not understand why we have both .flake8 and tox.ini.

@vincentqb
Copy link
Contributor Author

Quick partial notes:

  • text also has both files, but not pytorch and vision.
  • vision has F401 too.
  • Ideally, we should have a consensus between domains and pytorch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants