Skip to content

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

@jomcgi

Description

@jomcgi

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: #3399 (comment)

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions