Use flake8 type checking#4787
Conversation
There was a problem hiding this comment.
Awesome! I like this a lot more than I even thought I would -- it really makes the usage of imports unambiguous.
A few corrections/nits to pick, and then also one question -- since upstream seems open to adding a whitelist, is it waiting so we can drop # noqa? The good news is when the whitelist is added, yesqa should automate removing those comments.
Alternatively, there is https://pypi.org/project/future-annotations/, but I'm not sure how it will interact with the rest of our tooling.
| @@ -1 +1 @@ | |||
| from poetry.masonry.builders.editable import EditableBuilder | |||
| from poetry.masonry.builders.editable import EditableBuilder # noqa: TC002 | |||
There was a problem hiding this comment.
Wondering if we should exempt __init__.py from TC002 like we do from F401 in .flake8.
There was a problem hiding this comment.
Not sure. Probably, suitable for most __init__.py files. However, some files like poetry/mixology/__init__.py should probably not be excluded. Maybe, the same applies to F401. 🤷♂️ I'll change it if you like.
I'll try the whitelist as soon as it has been added upstream. That should remove a lot of |
…s feature for imports of typing and typing-extensions so that noqa comments are not required anymore
e559301 to
1c8fb8b
Compare
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Relates-to: #4776