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

Ruff: enable all pyflakes and perf rules #4556

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Aug 11, 2024

Summary of changes

Setuptools conforms to all the Ruff-implemented Pyflakes and Perflint rules except PERF203 and a single instance of PERF102. So we can be less picky about their selection.

PERF203 is worth looking at, but is often a micro-optimisation with false-positives, let's not block the CI on that. I applied it on some tests.

Pull Request Checklist

  • Changes have tests (these are new static tests)
  • News fragment added in newsfragments/. (no public-facing change)
    (See documentation for details)

@Avasam Avasam force-pushed the ruff-all-pyflakes-and-perf-rules branch 2 times, most recently from 1f341a8 to ca0f6c7 Compare August 16, 2024 22:54
@Avasam Avasam force-pushed the ruff-all-pyflakes-and-perf-rules branch 2 times, most recently from 22a9da2 to 5345768 Compare August 27, 2024 14:59
@Avasam Avasam force-pushed the ruff-all-pyflakes-and-perf-rules branch from 5345768 to 5aed410 Compare August 28, 2024 15:10
@Avasam Avasam force-pushed the ruff-all-pyflakes-and-perf-rules branch from 5aed410 to acf10fd Compare September 11, 2024 19:10
@Avasam Avasam force-pushed the ruff-all-pyflakes-and-perf-rules branch from acf10fd to 1f4b082 Compare September 30, 2024 19:41
@Avasam Avasam force-pushed the ruff-all-pyflakes-and-perf-rules branch from 1f4b082 to 01c7ce4 Compare October 15, 2024 16:09
@Avasam Avasam closed this Oct 21, 2024
@Avasam Avasam reopened this Oct 21, 2024
@Avasam
Copy link
Contributor Author

Avasam commented Oct 21, 2024

It's been a couple PRs where the PyPy test gets randomly cancelled, that's weird

Copy link
Contributor

@abravalheri abravalheri left a comment

Choose a reason for hiding this comment

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

Thank you very much.

@@ -2187,7 +2187,7 @@ def get_args(cls, dist, header=None):
spec = str(dist.as_requirement())
for type_ in 'console', 'gui':
group = type_ + '_scripts'
for name, ep in dist.get_entry_map(group).items():
for name in dist.get_entry_map(group).keys():
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are not using the values, then we can just iterate over the original object no? There would be no reason to call .keys(), right?

Copy link
Contributor Author

@Avasam Avasam Oct 21, 2024

Choose a reason for hiding this comment

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

yeah iterating over a dict should be the same as iterating over its keys since we don't do anything special with the view-object. I kept it consistent with other places in code. (this might be an opiniated preference)

@Avasam Avasam force-pushed the ruff-all-pyflakes-and-perf-rules branch from cccadd2 to d771884 Compare October 21, 2024 23:03
@abravalheri abravalheri merged commit a39336b into pypa:main Oct 22, 2024
25 checks passed
@abravalheri
Copy link
Contributor

Thank you @Avasam.

@Avasam Avasam deleted the ruff-all-pyflakes-and-perf-rules branch October 22, 2024 14:47
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