Skip to content

Update protobuf generated stubs from mypy-protobuf 2.8 #5804

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

Merged
merged 1 commit into from
Jul 23, 2021

Conversation

nipunn1313
Copy link
Contributor

Includes features from 2.7 and 2.8
https://github.com/dropbox/mypy-protobuf/blob/master/CHANGELOG.md

Notably

  • propagate comments
  • Field ordering in original order
  • remove type-ignore used on enums

@@ -73,3 +73,5 @@ protoc_install/bin/protoc --proto_path=$PYTHON_PROTOBUF_DIR/src --mypy_out=$REPO

isort $REPO_ROOT/stubs/protobuf
black $REPO_ROOT/stubs/protobuf

sed -i="" 's/mypy-protobuf [^"]*/mypy-protobuf 2.8/' $REPO_ROOT/stubs/protobuf/METADATA.toml
Copy link
Member

Choose a reason for hiding this comment

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

Maybe just put ${MYPY_PROTOBUF_VERSION} here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops! Thanks for catching

Copy link
Collaborator

@Akuli Akuli Jul 23, 2021

Choose a reason for hiding this comment

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

You need to switch to double quotes, because variables aren't substituted inside single quotes. But then you need to escape the double quote in the regex:

Suggested change
sed -i="" 's/mypy-protobuf [^"]*/mypy-protobuf 2.8/' $REPO_ROOT/stubs/protobuf/METADATA.toml
sed -i="" "s/mypy-protobuf [^\"]*/mypy-protobuf 2.8/" $REPO_ROOT/stubs/protobuf/METADATA.toml

I think I got it right, but I'm not sure. Make sure to try it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep @Akuli is right - I had to make that exact change.

@nipunn1313 nipunn1313 force-pushed the bump_to_mypy_protobuf_28 branch from 149eec3 to 657ebbb Compare July 23, 2021 23:04
@JelleZijlstra JelleZijlstra merged commit 581b2d5 into python:master Jul 23, 2021
@nipunn1313 nipunn1313 deleted the bump_to_mypy_protobuf_28 branch February 7, 2022 01:42
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