Skip to content

Conversation

@copybara-service
Copy link

@copybara-service copybara-service bot commented Feb 28, 2024

Register Scalar/MessageMapContainerTypes as virtual subclasses of MutableMapping instead of inheriting directly.

This prevents these from using abc.ABCMeta metaclass to avoid deprecation warning:

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.

Fixes #15077
Fixes #12186

@copybara-service copybara-service bot force-pushed the test_609782761 branch 3 times, most recently from 2bee52f to 80e7375 Compare March 6, 2024 01:42
…ableMapping instead of inheriting directly.

This prevents these from using abc.ABCMeta metaclass to avoid deprecation warning:
```
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.
```

Fixes #15077
Fixes #12186

PiperOrigin-RevId: 613029479
@brcsw
Copy link

brcsw commented May 31, 2024

It seems likely that GCP's gcloud CLI is broken after this change: https://issuetracker.google.com/issues/343748810

andife pushed a commit to onnx/onnx that referenced this pull request Oct 20, 2025
### Motivation and Context

We are seeing test errors on MacOS and Python 3.14. These errors come
from Protobuf and they were fixed in
#protocolbuffers/protobuf#15999 and the PR was
contained since 6.31.0.

Signed-off-by: Yuanyuan Chen <cyyever@outlook.com>
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.

Python DeprecationWarning: uses PyType_Spec with a metaclass that has custom tp_new Compiled Python extension does not work with Python 3.12

2 participants