open-telemetry / open-telemetry/opentelemetry-python-contrib

Enable future annotations check in ruff/isort to reduce churn during python upgrades

Open
#3,428 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

What problem do you want to solve?

Python upgrades allow us to utilize new typing features, implementing them during upgrades means touching a lot of files.

Describe the solution you'd like

Some of these typing improvements are available through future annotations.
If we enable:

  • Mandatory future annotation import through isort
  • Future annotations type checking through ruff

Then our code will be as forwards compatible as it can be for the baseline version of python reducing the amount of changes required to take advantage of new features.

Describe alternatives you've considered

Adding steps to the instructions for bumping the baseline instead of continuously enforcing it through ruff/isort.
This is possible but it would still result in a large number of code changes during upgrade as new files / instrumentations would not have benefited from the continuous check.

Additional Context

Related discussion on PR deprecating Python 3.8: https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3399#discussion_r2024583519

Would you like to implement a fix?

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the repository's Ruff and isort configuration and review the related Python 3.8 deprecation discussion in PR #3399. Enable the requested future-annotation import and type checks, then run the configured lint checks to confirm existing code passes and the rules are enforced.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.