-
Notifications
You must be signed in to change notification settings - Fork 17
Release/2.14.4 #423
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
Release/2.14.4 #423
Conversation
Please update the version number to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems the SDK Is broken after the Protobuf upgrade. Tested with Digital ID example app (flask) and got an error. Part of the error:
File "/Users/bansalsa/Documents/Yoti-GitHub-Examples/yoti-python-sdk-release-2.14.4/examples/yoti_example_flask/.venv/lib/python3.12/site-packages/google/protobuf/descriptor.py", line 933, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Some tests are failing, so might need to update them before merging.
|
Update protobuf to 4.21.12+ and modernize Python support
📋 Summary
This PR updates the protobuf library from 3.20.3 to >=4.21.12 and modernizes Python version support to align with current security standards and ecosystem best practices.
🔄 Changes Made
Core Dependencies
3.20.3
→>=4.21.12
python_requires=">=3.9"
Python Version Support
Files Modified
setup.py
: Updated protobuf version and Python classifiersrequirements.in
: Updated protobuf dependencyrequirements.txt
: Regenerated with new protobuf version.github/workflows/sonar.yaml
: Added protobuf compatibility environment variable.github/workflows/tests.yaml
: Added protobuf compatibility environment variable🚨 Breaking Changes
1 Protobuf Major Version: Upgraded from 3.x to 4.x
🔍 Technical Details
Protobuf 4.21.12+ Benefits
Python 3.9+ Modernization
Generated Protobuf Files
The existing protobuf generated files (
*_pb2.py
) inyoti_python_sdk/protobuf/
were created with an older protobuf compiler. While they continue to work with the environment variable workaround, they should ideally be regenerated with protoc >= 3.19.0 for optimal performance.Recommended Testing Steps