Skip to content
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

Fix loader type annotations for mypy>=0.750 #313

Closed
c24t opened this issue Dec 3, 2019 · 3 comments
Closed

Fix loader type annotations for mypy>=0.750 #313

c24t opened this issue Dec 3, 2019 · 3 comments
Labels

Comments

@c24t
Copy link
Member

c24t commented Dec 3, 2019

We started seeing mypy test failures in loader.py after the upgrade to 0.750 in #258.

% mypy --namespace-packages opentelemetry-api/src/opentelemetry/util/loader.py
opentelemetry-api/src/opentelemetry/util/loader.py:181: error: Incompatible types in assignment (expression has type "Callable[[Type[_T]], Optional[object]]", variable has type "Optional[Callable[[Type[object]], Optional[object]]]")
Found 1 error in 1 file (checked 1 source file)

I pinned the mypy version in 792449e as a temporary fix, but we need to update the annotations to work with latest.

@toumorokoshi toumorokoshi added the good first issue Good first issue label Jan 14, 2020
@sethmaxwl
Copy link
Contributor

Is this still an issue? loader.py doesn't seem to exist in that location anymore.

@aabmass
Copy link
Member

aabmass commented Jun 2, 2020

Mypy is still pinned, but I guess this was closed by #466 which removed loader.py. I can create a new issue for the untyped file added it in that PR and see if mypy can be upgraded:

# FIXME find a better way to avoid all those "Expression has type "Any"" errors
# type: ignore

@lzchen
Copy link
Contributor

lzchen commented Jun 2, 2020

@aabmass
Sounds like a good idea. Create a new issue, link this old one, and see if the mypy issue still persists. I can assign it to you one you create it.

@lzchen lzchen closed this as completed Jun 2, 2020
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
closes open-telemetry#313

Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants