Unsuppressible mypy syntax error for azure.core when using it from a typechecked project with python 3.9.0 #15762
Labels
Azure.Core
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
Importing from
azure.core.*
will cause a hard-to-suppress mypy typechecking error about internal type annotations of azure core that have syntax errors.I don't understand why it only happens on 3.9.0.
Note that mypy has a really hard time with syntax errors: python/mypy#6897 which makes it hard for the end user to ignore them.
To Reproduce
pip install -r requirements.lock.txt
file.mypy -p test
. You'll get something like.../python3.9/site-packages/azure/core/pipeline/policies/_authentication.py:33: error: syntax error in type comment '(TokenCredential, *str, Mapping[str, Any]) -> None
ignore_errors = True
in themypy.ini
file.mypy -p test
still errors out.Expected behavior
No type errors when using default mypy settings, or an error saying there aren't any types available.
The text was updated successfully, but these errors were encountered: