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

Update black to 24.4.0 #12594

Merged
merged 3 commits into from
Apr 14, 2024
Merged

Update black to 24.4.0 #12594

merged 3 commits into from
Apr 14, 2024

Conversation

notatallshaw
Copy link
Member

@notatallshaw notatallshaw commented Mar 24, 2024

A couple of important changes to black since the last update, the new 2024 stable style: https://github.com/psf/black/releases/tag/24.1.0. And a minor CVE (which I guess someone could use to attack pip's github workers?): https://github.com/psf/black/releases/tag/24.3.0

Most the noise in the new stable style comes from more opinionated choices about where new lines should or shouldn't be, and that ... shouldn't be on it's own line for empty class or method definitions.

But there are a few nice things, like get item syntax is strongly preffered to keep on the same line, e.g.

            existing_req: Optional[
                InstallRequirement
            ] = requirement_set.get_requirement(install_req.name)

Turns in to this:

            existing_req: Optional[InstallRequirement] = (
                requirement_set.get_requirement(install_req.name)
            )

ruff also has already adopted the black 2024 stable style, so were pip to eventually switch to ruff (#12478) for formatting this would produce a smaller diff with the most recent versions of ruff.

@sbidoul
Copy link
Member

sbidoul commented Apr 14, 2024

Looks good. Can you rebase?

@notatallshaw notatallshaw changed the title Update black to 24.3.0 Update black to 24.4.0 Apr 14, 2024
@notatallshaw
Copy link
Member Author

Rebased and updated to 24.4.0 which has a crash fix: https://github.com/psf/black/releases/tag/24.4.0

@sbidoul sbidoul merged commit be278a3 into pypa:main Apr 14, 2024
24 checks passed
@sbidoul
Copy link
Member

sbidoul commented Apr 14, 2024

Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants