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

Re add toplevel py.typed file #4084

Merged
merged 3 commits into from
Jul 29, 2024
Merged

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
284 checks passed
@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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants