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

Enforce ruff/Perflint rules (PERF) #265

Merged
merged 5 commits into from
Aug 22, 2024
Merged

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Jun 29, 2024

I have not applied this one:

PERF203 `try`-`except` within a loop incurs performance overhead

I believe the rest of the changes result in more readable code, but I am not certain about this one. In the absence of measured performance gains, I have left it out. I am happy to apply the PERF203 rule as well if you want me too.

Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

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

Looks good. I have a few comments/suggestions, and a TODO for me to investigate what's going on with the diff.

distutils/bcppcompiler.py Outdated Show resolved Hide resolved
distutils/ccompiler.py Outdated Show resolved Hide resolved
distutils/command/sdist.py Outdated Show resolved Hide resolved
distutils/command/sdist.py Outdated Show resolved Hide resolved
distutils/unixccompiler.py Outdated Show resolved Hide resolved
ruff.toml Show resolved Hide resolved
PERF102 When using only the values of a dict use the `values()` method
PERF402 Use `list` or `list.copy` to create a copy of a list
@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented Aug 22, 2024

About the previous CI failure: my "fix" for PERF403 was completely wrong. Tests pass now.

@jaraco jaraco merged commit d776697 into pypa:main Aug 22, 2024
19 of 21 checks passed
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.

2 participants