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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set protobuf verion as ~=3.19.0 #4779

Closed

Conversation

whitphx
Copy link
Contributor

@whitphx whitphx commented May 26, 2022

馃摎 Context

Please describe the project or issue background here

  • What kind of change does this PR introduce?

    • Bugfix
    • Feature
    • Refactoring
    • Other, please describe:

馃 Description of Changes

The current version specification allows installing versions that have breaking-changes, e.g. major version-ups.

~= should be used rather than >=.

I also found that protobuf<=3.18.0 are also not working with the current codebase as it emits the error below during make mini-devel:

protoc \
                --proto_path=proto \
                --python_out=lib \
                --mypy_out=lib \
                proto/streamlit/proto/*.proto
Traceback (most recent call last):
  File "/path/to/workspace/streamlit/lib/.venv/bin/protoc-gen-mypy", line 5, in <module>
    from mypy_protobuf.main import main
  File "/path/to/workspace/streamlit/lib/.venv/lib/python3.10/site-packages/mypy_protobuf/main.py", line 26, in <module>
    from . import extensions_pb2
  File "/path/to/workspace/streamlit/lib/.venv/lib/python3.10/site-packages/mypy_protobuf/extensions_pb2.py", line 22, in <module>
    casttype = DESCRIPTOR.extensions_by_name['casttype']
AttributeError: 'NoneType' object has no attribute 'extensions_by_name'
--mypy_out: protoc-gen-mypy: Plugin failed with status code 1.
make: *** [protobuf] Error 1

I think other dependencies also should be specified in better way like ~= instead of >= or * though this PR does not include them as it's not urgent.

馃И Testing Done

  • Screenshots included
  • Added/Updated unit tests
  • Added/Updated e2e tests

馃寪 References

https://discuss.streamlit.io/t/streamlit-run-with-protocbuf-error/25632

  • Issue: Closes #XXXX

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@kmcgrady
Copy link
Collaborator

Thanks @whitphx for bringing this up to us! We found a solution and merged it in. This will be in the next version release! I will close this.

@kmcgrady kmcgrady closed this May 26, 2022
@whitphx
Copy link
Contributor Author

whitphx commented May 27, 2022

@kmcgrady Thank you,
The problem itself has been solved with #4781 then in addtion the minimum version was also updated as 3.12 in #4783.
However at least in my environment protobuf<3.19 does not work with make mini-devel as described in this PR above, so I think it should be >=3.19.
What do you think?

@whitphx whitphx deleted the fix/specify-protobuf-version branch May 27, 2022 08:42
@kmcgrady
Copy link
Collaborator

Hey @whitphx! I brought this up to the team and they mentioned it working on a lower version. I'll cc @LukasMasuch to follow up to be sure.

@LukasMasuch
Copy link
Collaborator

Hey @whitphx, It seems to be broken for development with protobuf<3.19. But streamlit (at runtime) is running fine with protobuf>=3.12. I think in this case we need to add protobuf = ">=3.19, <4" to our dev dependencies. I will add a PR for this 馃憤

@whitphx
Copy link
Contributor Author

whitphx commented May 28, 2022

@LukasMasuch Hi, it makes sense. Thank you!

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.

None yet

3 participants