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

Replace obsolete types #644

Conversation

daniel-zullo-frequenz
Copy link
Contributor

The tool pyupgrade was used to modernize the code base given that frequenz-SDK is already using python 3.11 as minimum version. The tool was mainly used to replace obsolete types.

Just as a reference the tool was run with the following shell command:

find ./src ./benchmarks ./docs ./examples ./tests -name '*.py' -exec pyupgrade --py311-plus {} \;

Also black and isort were both run to format the code base after running pyupgrade.

Fixes #433

The tool `pyupgrade` was used to modernize the code base
given that frequenz-SDK is already using python 3.11
as minimum version.
The tool was mainly used to replace obsolete types.

Just as a reference the tool was run with the following shell command:

```sh
find ./src ./benchmarks ./docs ./examples \
    ./tests -name '*.py' -exec pyupgrade --py311-plus {} \;
```

Also black and isort were both run to format the code base after
running pyupgrade.

Signed-off-by: Daniel Zullo <daniel.zullo@frequenz.com>
Signed-off-by: Daniel Zullo <daniel.zullo@frequenz.com>
Signed-off-by: Daniel Zullo <daniel.zullo@frequenz.com>
Most of the annotations from __future__ are no longer needed,
except for the cases where there are circular dependencies,
forward references, or when the type hint is used inside the
class itself.

Signed-off-by: Daniel Zullo <daniel.zullo@frequenz.com>
@daniel-zullo-frequenz daniel-zullo-frequenz requested a review from a team as a code owner September 6, 2023 14:03
@daniel-zullo-frequenz daniel-zullo-frequenz self-assigned this Sep 6, 2023
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:data-pipeline Affects the data pipeline part:actor Affects an actor ot the actors utilities (decorator, etc.) part:core Affects the SDK core components (data structures, etc.) part:microgrid Affects the interactions with the microgrid part:config Affects the configuration management labels Sep 6, 2023
@daniel-zullo-frequenz daniel-zullo-frequenz added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Sep 6, 2023
@daniel-zullo-frequenz daniel-zullo-frequenz added this pull request to the merge queue Sep 7, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit a889296 Sep 7, 2023
@daniel-zullo-frequenz daniel-zullo-frequenz deleted the fix/remove-obsolete-types branch September 7, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd:skip-release-notes It is not necessary to update release notes for this PR part:actor Affects an actor ot the actors utilities (decorator, etc.) part:config Affects the configuration management part:core Affects the SDK core components (data structures, etc.) part:data-pipeline Affects the data pipeline part:docs Affects the documentation part:microgrid Affects the interactions with the microgrid part:tests Affects the unit, integration and performance (benchmarks) tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove obsolete uses of typing.*
2 participants