Skip to content

Bump mypy to 1.9.0#3795

Merged
lzchen merged 8 commits intoopen-telemetry:mainfrom
xrmx:bump-mypy
Apr 2, 2024
Merged

Bump mypy to 1.9.0#3795
lzchen merged 8 commits intoopen-telemetry:mainfrom
xrmx:bump-mypy

Conversation

@xrmx
Copy link
Copy Markdown
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

@xrmx xrmx requested a review from a team March 20, 2024 13:47
@ocelotl
Copy link
Copy Markdown
Contributor

ocelotl commented Mar 20, 2024

mypy is failing, please take a look ✌️

@xrmx
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

xrmx added 2 commits March 26, 2024 20:38
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
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