Visitar URL original
Update protobuf generated stubs from mypy-protobuf 2.8 by nipunn1313 · Pull Request #5804 · python/typeshed · GitHub
The Wayback Machine - https://web.archive.org/web/20260330002336/https://github.com/python/typeshed/pull/5804
Skip to content

Update protobuf generated stubs from mypy-protobuf 2.8#5804

Merged
JelleZijlstra merged 1 commit intopython:masterfrom
nipunn1313:bump_to_mypy_protobuf_28
Jul 23, 2021
Merged

Update protobuf generated stubs from mypy-protobuf 2.8#5804
JelleZijlstra merged 1 commit intopython:masterfrom
nipunn1313:bump_to_mypy_protobuf_28

Conversation

@nipunn1313
Copy link
Copy Markdown
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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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