-
-
Notifications
You must be signed in to change notification settings - Fork 344
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 flake8-type-checking rule #2813
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2813 +/- ##
==========================================
- Coverage 99.18% 99.18% -0.01%
==========================================
Files 115 115
Lines 17611 17551 -60
Branches 3149 3149
==========================================
- Hits 17468 17408 -60
Misses 99 99
Partials 44 44
|
I would argue against this, type hints are useful to have at runtime. This will break Sphinx for instance. |
is Sphinx == ReadTheDocs here? There are (only) 4 errors, or is the signatures in the documentation broken? Digging around a bit, it seems you can get Sphinx to run with |
pre-commit.ci autofix |
RTD build is failing, which I'm pretty sure it's not on master, so something is being messed up somewhere. |
Errors I'm seeing in the most recent run RTD had:
Not completely sure what this means, something about something missing from docstrings? I'm sure if I looked into it deeper I could figure it out but if anyone has more information I would be glad for the advise. Otherwise I'll do some research later and we can get this taken care of. |
similar problems required aliases or similar in |
Sphinx isn't able to find those names when it's trying to evaluate the annotations - possibly because those functions were imported into a different class or something. Probably need to move the imports out of |
this shouldn't be the case if 4764ba2 is working as expected. |
google/pytype#1066 seems to be having a similar issue with |
… the changes work, it's all magic
I kind of expected the RTD build to fail, but apparently it runs on 3.9+, whoop whoop.
I didn't manage to figure out any way of getting |
I thought I would mention it, one of the only internet search results with anything potentially related. Maybe I was just looking in the wrong places, but it seems like sphinx doesn't have very much information about fixing errors. Thank you so much for helping with this, I was definitely struggling a bit! |
For |
I tried |
teamwork! 🚀 |
This PR enables the ruff flake8-type-checking rule (TCH).
From flake8-type-checking's description, the main benefit of this would be avoiding the overhead of type hint imports at runtime.