GeezerVison is showing github.com — feat: add support for python 3.12 by parthea · Pull Request #400 · googleapis/proto-plus-python
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
Conversation
parthea
commented
Oct 19, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
parthea
commented
Oct 19, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
nox > py.test -W=error --quiet --cov=proto --cov-config=.coveragerc --cov-report=term --cov-report=html tests
ImportError while loading conftest '/home/runner/work/proto-plus-python/proto-plus-python/tests/conftest.py'.
tests/conftest.py:[18](https://github.com/googleapis/proto-plus-python/actions/runs/6577031279/job/17867761605?pr=400#step:6:19): in <module>
from google.protobuf import descriptor_pool
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/descriptor_pool.py:63: in <module>
from google.protobuf import descriptor
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/descriptor.py:40: in <module>
from google.protobuf.internal import api_implementation
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/internal/api_implementation.py:74: in <module>
if _CanImport('google._upb._message'):
.nox/unitupb-3-12/lib/python3.12/site-packages/google/protobuf/internal/api_implementation.py:64: in _CanImport
mod = importlib.import_module(mod_name)
E SystemError: <class 'DeprecationWarning'> returned a result with an exception set
See related thread protocolbuffers/protobuf#12186. @ohmayr and I are looking into it.
EDIT: The reason that there is a SystemError is because we're treating warnings as errors when we run tests
If we remove -W=error all tests pass.
The warnings that appear are as follows:
<frozen importlib._bootstrap>:488
<frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
<frozen importlib._bootstrap>:488
<frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
.nox/unit-3-12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:93
/usr/local/google/home/partheniou/git/proto-plus-python/.nox/unit-3-12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:93: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
_EPOCH_DATETIME_NAIVE = datetime.datetime.utcfromtimestamp(0)
proto/datetime_helpers.py:24
/usr/local/google/home/partheniou/git/proto-plus-python/proto/datetime_helpers.py:24: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
_UTC_EPOCH = datetime.datetime.utcfromtimestamp(0).replace(tzinfo=datetime.timezone.utc)
Filed #401 for the warning related to proto-plus. The other 3 warnings are in the protobuf code. I'll disable warnings as errors and file a bug to re-enable the -W=error flag once the warnings are fixed upstream.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…romtimestamp(0) which is deprecated
|
|
if proto == "cpp": # 4.20 does not have cpp.
|
|
|
session.install("protobuf==3.19.0")
|
|
|
|
|
|
# The warnings as errors flag `-W=error` was removed in
|
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.
Worth filing an issue for this, and linking it here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Oh, I see. #403 is the issue tracking this. So fixing #403 MEANS re-enabling the warning.
|
# The warnings as errors flag `-W=error` was removed in |
|
# TODO(https://github.com/googleapis/proto-plus-python/issues/403): re-enable -W=error |
|
# The warnings-as\-errors flag `-W=error` was removed in |
|
# https://github.com/googleapis/proto-plus-python/pull/400. |
|
# It should be re-added once issue https://github.com/protocolbuffers/protobuf/issues/12186 is fixed. |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
if proto == "cpp": # 4.20 does not have cpp.
|
|
|
session.install("protobuf==3.19.0")
|
|
|
|
|
|
# The warnings as errors flag `-W=error` was removed in
|
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.
Oh, I see. #403 is the issue tracking this. So fixing #403 MEANS re-enabling the warning.
|
# The warnings as errors flag `-W=error` was removed in |
|
# TODO(https://github.com/googleapis/proto-plus-python/issues/403): re-enable -W=error |
|
# The warnings-as\-errors flag `-W=error` was removed in |
|
# https://github.com/googleapis/proto-plus-python/pull/400. |
|
# It should be re-added once issue https://github.com/protocolbuffers/protobuf/issues/12186 is fixed. |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
2 more reviewers
ohmayr
ohmayr approved these changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|