Skip to content

[Python] Upgrade black#39774

Closed
asheshvidyut wants to merge 1 commit intogrpc:masterfrom
asheshvidyut:upgrade-black
Closed

[Python] Upgrade black#39774
asheshvidyut wants to merge 1 commit intogrpc:masterfrom
asheshvidyut:upgrade-black

Conversation

@asheshvidyut
Copy link
Copy Markdown
Member

@asheshvidyut asheshvidyut commented Jun 6, 2025

Description

  • Upgrade Black to use the latest version. Pypi-Black (25.1.0)
  • Run black to reformat files to make the sanity tests pass in CI

Note - all the file changes are by black command except for the black version bump which is

https://github.com/grpc/grpc/pull/39774/files#diff-0512cc461bc04ba96303b81398cc5926bd16e120cbe48decd0c44ea0a8fb76e6R36

Testing

CI

@asheshvidyut asheshvidyut added release notes: no Indicates if PR should not be in release notes release notes: yes Indicates if PR needs to be in release notes kokoro:run and removed release notes: no Indicates if PR should not be in release notes labels Jun 6, 2025
@asheshvidyut asheshvidyut changed the title Upgrade black [Python] Upgrade black Jun 6, 2025
return grpc_message;
// Just to check if CI passes
return std::move(grpc_message);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is added to make the CI pass. Will revert this after CI passes.

Copy link
Copy Markdown
Contributor

@sreenithi sreenithi left a comment

Choose a reason for hiding this comment

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

LGTM.
A little unrelated, but while reviewing, I found that we have this black.toml file where we have missed updating the supported Python versions so far. We can either update it in this PR itself as part of fixing black or have a separate PR later to do it.

@asheshvidyut
Copy link
Copy Markdown
Member Author

LGTM. A little unrelated, but while reviewing, I found that we have this black.toml file where we have missed updating the supported Python versions so far. We can either update it in this PR itself as part of fixing black or have a separate PR later to do it.

Thanks. Will create another PR for that.

Copy link
Copy Markdown
Member

@sergiitk sergiitk left a comment

Choose a reason for hiding this comment

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

LGTM - a few things can be fixed in a separate PR.

default_initializer: str = ( # If non-empty, this will be used as the default initialization of this field
default_initializer: (
str
) = ( # If non-empty, this will be used as the default initialization of this field
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should probably just move these comments up one level. But in a separate PR.

Comment on lines +17 to +18
:path: /foo/bar
content-type: application/grpc
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm pretty sure the indent in front of headers is on purpose - this indicates <code> block.

copybara-service bot pushed a commit that referenced this pull request Jun 13, 2025
1. Follow up on comments in #39774.
2. Fix poorly formatted multiple assignment statements in src/python/grpcio/grpc/_channel.py (from the initial black migration).

Closes #39820

COPYBARA_INTEGRATE_REVIEW=#39820 from sergiitk:python-minor-syntax-improvements 0d7ac57
PiperOrigin-RevId: 771200864
anniefrchz pushed a commit to anniefrchz/grpc that referenced this pull request Jun 25, 2025
### Description

* Upgrade Black to use the latest version. [Pypi-Black (25.1.0)](https://pypi.org/project/black/)
* Run `black` to reformat files to make the sanity tests pass in CI

**Note - all the file changes are by `black` command** except for the black version bump which is

https://github.com/grpc/grpc/pull/39774/files#diff-0512cc461bc04ba96303b81398cc5926bd16e120cbe48decd0c44ea0a8fb76e6R36

### Testing
CI

Closes grpc#39774

PiperOrigin-RevId: 769640677
anniefrchz pushed a commit to anniefrchz/grpc that referenced this pull request Jun 25, 2025
…39820)

1. Follow up on comments in grpc#39774.
2. Fix poorly formatted multiple assignment statements in src/python/grpcio/grpc/_channel.py (from the initial black migration).

Closes grpc#39820

COPYBARA_INTEGRATE_REVIEW=grpc#39820 from sergiitk:python-minor-syntax-improvements 0d7ac57
PiperOrigin-RevId: 771200864
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Aug 23, 2025
### Description

* Upgrade Black to use the latest version. [Pypi-Black (25.1.0)](https://pypi.org/project/black/)
* Run `black` to reformat files to make the sanity tests pass in CI

**Note - all the file changes are by `black` command** except for the black version bump which is

https://github.com/grpc/grpc/pull/39774/files#diff-0512cc461bc04ba96303b81398cc5926bd16e120cbe48decd0c44ea0a8fb76e6R36

### Testing
CI

Closes grpc#39774

PiperOrigin-RevId: 769640677
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Aug 23, 2025
…39820)

1. Follow up on comments in grpc#39774.
2. Fix poorly formatted multiple assignment statements in src/python/grpcio/grpc/_channel.py (from the initial black migration).

Closes grpc#39820

COPYBARA_INTEGRATE_REVIEW=grpc#39820 from sergiitk:python-minor-syntax-improvements 0d7ac57
PiperOrigin-RevId: 771200864
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants