Skip to content

Make pyright run in standard mode#4425

Merged
aabmass merged 15 commits intoopen-telemetry:mainfrom
pierceroberts:mypy-to-pyright
Mar 12, 2025
Merged

Make pyright run in standard mode#4425
aabmass merged 15 commits intoopen-telemetry:mainfrom
pierceroberts:mypy-to-pyright

Conversation

@pierceroberts
Copy link
Copy Markdown
Contributor

@pierceroberts pierceroberts commented Feb 13, 2025

Description

Partially address:
#4404

Fixes # (issue)

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

  • Run pre-commit with out issues
  • python -m pyright runs successfully
  • python -m mypy does not run.

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

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Feb 13, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@pierceroberts
Copy link
Copy Markdown
Contributor Author

@emdneto and @Kludex for visibility. Still a few things to iron out. Feel free to comment as I go.

Comment thread CONTRIBUTING.md Outdated
Comment thread mypy-relaxed.ini
Comment thread tox.ini
Comment thread scripts/proto_codegen.sh Outdated
Comment thread tox.ini Outdated
Copy link
Copy Markdown
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to get CLA signed to get things merged, so please take a look at the CLA error

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
Comment thread pyproject.toml Outdated
Comment thread scripts/proto_codegen.sh Outdated
Comment thread scripts/proto_codegen.sh
Comment thread tox.ini Outdated
Comment thread pyright-requirements.txt Outdated
@pierceroberts pierceroberts marked this pull request as ready for review February 19, 2025 17:09
@pierceroberts pierceroberts requested a review from a team as a code owner February 19, 2025 17:09
Comment thread pyproject.toml Outdated
Comment thread CONTRIBUTING.md
@pierceroberts pierceroberts requested a review from emdneto March 7, 2025 05:10
Copy link
Copy Markdown
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment thread pyproject.toml Outdated
Comment thread tox.ini Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Copy link
Copy Markdown
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is, in strict mode, there are a lot of fixes to do even for opentelemetry-api (124 errors, 0 warnings, 0 informations) which is already fine according to mypy setup. so I'm thinking on the following plan:

  1. Keep mypy in CI for a while
  2. Add pyright in standard mode, with a strict list (this PR)
  3. Fix typing issues from the exclude list in follow-up small PRs
  4. When the fix list for at least opentelemetry-api and opentelemetry-sdk/resources is done, we remove mypy from CI.

I did some changes to help this get in.

Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
@emdneto emdneto changed the title Changing mypy to pyright Make pyright run in standard mode Mar 8, 2025
Copy link
Copy Markdown
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds a like a plan, thanks!

@emdneto emdneto added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Mar 10, 2025
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Comment thread opentelemetry-api/src/opentelemetry/util/_decorator.py
emdneto added 3 commits March 11, 2025 12:59
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com>
@emdneto
Copy link
Copy Markdown
Member

emdneto commented Mar 11, 2025

@pierceroberts can you create a tracking issue with the typing issues we are ignoring here so we can fix them later?

  1. Fix typing issues from the exclude list in follow-up small PRs

Comment thread pyproject.toml
@aabmass aabmass enabled auto-merge (squash) March 11, 2025 22:22
@pierceroberts
Copy link
Copy Markdown
Contributor Author

@pierceroberts can you create a tracking issue with the typing issues we are ignoring here so we can fix them later?

  1. Fix typing issues from the exclude list in follow-up small PRs

@emdneto I created this tracking issue: #4479

@aabmass aabmass merged commit 7acbfb4 into open-telemetry:main Mar 12, 2025
@github-project-automation github-project-automation Bot moved this from Reviewed PR that needs fixing to Done in Python PR digest Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants