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

Bump mypy to 1.9.0 #3795

Merged
merged 8 commits into from
Apr 2, 2024
Merged

Bump mypy to 1.9.0 #3795

merged 8 commits into from
Apr 2, 2024

Conversation

xrmx
Copy link
Contributor

@xrmx xrmx commented Mar 20, 2024

Description

Bump mypy to 1.9.0. This should allow adding python 3.12 to CI.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • tox -e mypy

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@ocelotl
Copy link
Contributor

ocelotl commented Mar 20, 2024

mypy is failing, please take a look ✌️

@xrmx
Copy link
Contributor Author

xrmx commented Mar 21, 2024

There's a new error from the async context manager:

opentelemetry-api/src/opentelemetry/util/_decorator.py:81: error: Incompatible return value type (got "Callable[[VarArg(Pargs), KwArg(Pkwargs)], _AgnosticContextManager[R]]", expected "Callable[P, _AgnosticContextManager[R]]")  [return-value]

which I don't know how to fix

@xrmx
Copy link
Contributor Author

xrmx commented Mar 21, 2024

@QuentinN42 any hint on fixing the issue above? ↑

@xrmx xrmx marked this pull request as draft March 21, 2024 08:54
@QuentinN42
Copy link
Contributor

VarArg(Pargs) and KwArg(Pkwargs) are only available in python 3.9 or something...

I don't really remember how I typed the thing but it was a pain :(

I will try to take a look at this before today's meeting and come with more data.

Fixes the following mypy errors:

Call to abstract method "<method>" of "<class>" with trivial body
via super() is unsafe  [safe-super]
Silences the following error:
A function returning TypeVar should receive at least one argument
 containing the same TypeVar  [type-var]
xrmx and others added 3 commits March 26, 2024 20:59
Incompatible return value type
 (got "Callable[[VarArg(Pargs), KwArg(Pkwargs)], _AgnosticContextManager[R]]",
 expected "Callable[P, _AgnosticContextManager[R]]")  [return-value]

Co-authored-by: QuentinN42 <32516498+QuentinN42@users.noreply.github.com>
@xrmx xrmx marked this pull request as ready for review March 26, 2024 20:04
@lzchen lzchen merged commit cb800f0 into open-telemetry:main Apr 2, 2024
232 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants