Skip to content

Bump to protobuf==24.4 - #11686

Closed
ijknabla wants to merge 3 commits into
python:mainfrom
ijknabla:update/protobuf-v24
Closed

ijknabla wants to merge 3 commits into
python:mainfrom
ijknabla:update/protobuf-v24

Conversation

@ijknabla

@ijknabla ijknabla commented Apr 1, 2024

Copy link
Copy Markdown

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Apr 1, 2024

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau

srittau commented Apr 1, 2024

Copy link
Copy Markdown
Collaborator

Cc @nipunn1313

@Avasam

Avasam commented Apr 1, 2024

Copy link
Copy Markdown
Collaborator

Hi @ijknabla , since these files are auto-generated, one should also update the generator script along with them! Otherwise we risk loosing these changes and/or creating confusion next time they're run.
Look for the PROTOBUF_VERSION variable in https://github.com/python/typeshed/blob/main/scripts/generate_proto_stubs.sh . I don't remember if this bash script runs on windows under git bash, I might have used WSL last time I ran them.

@ijknabla

ijknabla commented Apr 1, 2024

Copy link
Copy Markdown
Author

Thanks to @Avasam , I now have a better understanding of the issues.

Latest release of types-protobuf 4.24.0.20240311 seems to provide a type hint for protobuf==4.24.0.

The referenced script shows that when types-protobuf==4.24.0.20240311 is generated, it is different from PROTOBUF_VERSION==4.21.8.

PYTHON_PROTOBUF_VERSION=4.21.8

Can we change to PROTOBUF_VERSION===4.24.0 and run this script again and release the result as types-protobuf 4.24.0.XXX?

@ijknabla

ijknabla commented Apr 1, 2024

Copy link
Copy Markdown
Author

Oh, Simple change did not work.

 # followed by committing the changes to typeshed
 #
 # Update these two variables when rerunning script
-PROTOBUF_VERSION=21.8
-PYTHON_PROTOBUF_VERSION=4.21.8
+PROTOBUF_VERSION=24.0
+PYTHON_PROTOBUF_VERSION=4.24.0
 MYPY_PROTOBUF_VERSION=3.5.0
$ ./scripts/generate_proto_stubs.sh
# 
+ wget https://github.com/protocolbuffers/protobuf/releases/download/v24.0/protobuf-python-4.24.0.zip
--2024-04-02 00:51:55--  https://github.com/protocolbuffers/protobuf/releases/download/v24.0/protobuf-python-4.24.0.zip
Resolving github.com (github.com)... 20.27.177.113
Connecting to github.com (github.com)|20.27.177.113|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-04-02 00:51:55 ERROR 404: Not Found.

I think that this is caused by a change in the release structure of protobuf.

If we don't think about script compatibility, we could solve this problem by simply updating the URL in the shell script.

@Avasam

Avasam commented Apr 1, 2024

Copy link
Copy Markdown
Collaborator

@ijknabla I'm working on updating the script for v22+ as we speak, expect a PR soon

@nipunn1313

Copy link
Copy Markdown
Contributor

script compatibility for generate_proto_stubs.sh is not important!
Note that I haven't tested the generator (mypy-protobuf) with the new protobuf 24.4 yet.

But in general, protobuf python API is pretty stable, so I think you can go for it.

@nipunn1313

Copy link
Copy Markdown
Contributor

I would expect some changes to METADATA.toml to happen as part of this PR too.

@nipunn1313

Copy link
Copy Markdown
Contributor

seems like we could bump to 25 and 26 as well
https://github.com/protocolbuffers/protobuf/releases/

@nipunn1313

Copy link
Copy Markdown
Contributor

I just released mypy-protobuf 3.6.0 that is confirmed compatible to protobuf 3.25.

I propose that you continue with this PR bumping to 24.4 - then later we can bump to 25 and a bit later after that 26.

@ijknabla

Copy link
Copy Markdown
Author

Thanks to all of you for your help in resolving this.
Thank you very much.

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.

4 participants