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

project: Fix and check pyupgrade issues #763

Merged
merged 11 commits into from
Nov 4, 2024

Conversation

pdgendt
Copy link
Collaborator

@pdgendt pdgendt commented Nov 2, 2024

Depending on the minimum supported python version (3.9 in our case), pyupgrade will report deprecated python features.
Extend ruff with pyupgrade checks.

Depends on #762

Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

The cleanup commit is a bit too big for my taste hence a bit painful to check... could you split it in say 2 or 3? Maybe one commit with all the type changes and another commit for the rest...

os.path.join(_session_repos, x) for x in
['Kconfiglib', 'tagged_repo', 'net-tools', 'zephyr']]
['Kconfiglib', 'tagged_repo', 'net-tools', 'zephyr'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious what was the warning here...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was actually a deprecated rule itself, which was still "automagically" fixed with ruff check --fix.

I've ignored this rule.

Derived from pyupgrade, see
https://docs.astral.sh/ruff/rules/f-string/

Signed-off-by: Pieter De Gendt <[email protected]>
Check for deprecated usages in the project when running ruff check.

Signed-off-by: Pieter De Gendt <[email protected]>
Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@pdgendt pdgendt merged commit 5341912 into zephyrproject-rtos:main Nov 4, 2024
16 checks passed
@pdgendt pdgendt deleted the tox-ruff-pyupgrade branch November 4, 2024 15:30
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.

3 participants