-
Notifications
You must be signed in to change notification settings - Fork 7k
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
flake8 and mypy errors #7200
Comments
Regarding
it seems I may have the same issue discussed in #7126. However, I directly followed the instructions in https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md#install-pytorch-nightly. Using conda during setup I ran If the contributing guide needs any updates I am also happy to make those as needed. |
Hey @mpearce25 and thanks for your interest in contributing. The issues here are twofold: You are likely using a different version of vision/.pre-commit-config.yaml Line 22 in 5ea8e01
Updating that
Something seem to have gone wrong there, because you have
in your env. This is the latest stable release, but development happens on the latest nightly release. If you fix that, your |
Resolved! Thanks for the help @pmeier The stable version of pytorch was getting installed over the nightly as my Regarding flake8:
|
In general yes, but I would put that into a different section. https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md#code-formatting-and-typing TBH, I don't know why While you are at it, you can also send a PR to upgrade to |
🐛 Describe the bug
I'm planning to contribute type annotations to the library as discussed and tracked in #2025. However, I encountered multiple flake8 and mypy errors on main as of
2cd25c1a05012a3720a87f20cec436811fadeedd
. I'd like to fix these before adding additional type annotations. If the proposed fixes below look good I can make a PR.Running
mypy --config-file mypy.ini
yieldsTo address these I would
# type: ignore[attr-defined]
afterfrom torch._C import DisableTorchFunctionSubclass
Running
flake8
yieldsTo address these I would
# type: (Dict[str, Tensor], List[Dict[str, Tensor]]) -> Union[Dict[str, Tensor], List[Dict[str, Tensor]]]
Versions
The text was updated successfully, but these errors were encountered: