Skip to content

Conversation

@jenshnielsen
Copy link
Contributor

@jenshnielsen jenshnielsen commented Jul 26, 2024

Description

This will ensure that the top-level opentelemetry module is marked as typed.
This was removed as part of #3385
where py.typed files were correctly added to submodules. However, a file at the top level is also required

In 1.26.0 if you try to to run pyright against a simple line such as:

from opentelemetry import trace
This will fail with an error such as

 pathtosomefile.py:12:6 - error: Stub file not found for "opentelemetry" (reportMissingTypeStubs)

An example of this failing can be seen in microsoft/Qcodes#6279

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manually ran pyright against code that fails with 1.26.0 against main branch with this fix and confirmed that error is gone

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added (N/A)
  • Documentation has been updated (N/A)

This will ensure that the toplevel opentelemetry module is marked as typed
@jenshnielsen jenshnielsen requested a review from a team July 26, 2024 06:47
@lzchen lzchen merged commit a9628b2 into open-telemetry:main Jul 29, 2024
@jenshnielsen jenshnielsen deleted the readd_py.typed branch July 30, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants