googleapis / python-pubsub

Apache License 2.0
391 stars 204 forks source link

Not compatible Python 3.13.0 ? #1275

Open m4dm4rtig4n opened 1 week ago

m4dm4rtig4n commented 1 week ago

Environment details

Steps to reproduce

  1. Upgrade to Python 3.13.0
  2. Just load library from google.cloud import pubsub_v1

Code example

from google.cloud import pubsub_v1

print("Hello World")

Stack trace

Traceback (most recent call last):
  File "./src/test.py", line 1, in <module>
    from google.cloud import pubsub_v1
  File "./.venv/lib/python3.13/site-packages/google/cloud/pubsub_v1/__init__.py", line 17, in <module>
    from google.cloud.pubsub_v1 import types
  File "./.venv/lib/python3.13/site-packages/google/cloud/pubsub_v1/types.py", line 39, in <module>
    from google.pubsub_v1.types import pubsub as pubsub_gapic_types
  File "./.venv/lib/python3.13/site-packages/google/pubsub_v1/__init__.py", line 21, in <module>
    from .services.publisher import PublisherClient
  File "./.venv/lib/python3.13/site-packages/google/pubsub_v1/services/publisher/__init__.py", line 16, in <module>
    from .client import PublisherClient
  File "./.venv/lib/python3.13/site-packages/google/pubsub_v1/services/publisher/client.py", line 57, in <module>
    from google.pubsub_v1.services.publisher import pagers
  File "./.venv/lib/python3.13/site-packages/google/pubsub_v1/services/publisher/pagers.py", line 40, in <module>
    from google.pubsub_v1.types import pubsub
  File "./.venv/lib/python3.13/site-packages/google/pubsub_v1/types/__init__.py", line 18, in <module>
    from .pubsub import (
    ...<48 lines>...
    )
  File "./.venv/lib/python3.13/site-packages/google/pubsub_v1/types/pubsub.py", line 25, in <module>
    from google.pubsub_v1.types import schema as gp_schema
  File "./.venv/lib/python3.13/site-packages/google/pubsub_v1/types/schema.py", line 507, in <module>
    class ValidateMessageResponse(proto.Message):
        r"""Response for the ``ValidateMessage`` method. Empty for now."""
  File "./.venv/lib/python3.13/site-packages/proto/message.py", line 279, in __new__
    file_info.generate_file_pb(new_class=cls, fallback_salt=full_name)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./.venv/lib/python3.13/site-packages/proto/_file_info.py", line 104, in generate_file_pb
    pool.Add(self.descriptor)
    ~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: Couldn't build proto file into descriptor pool: duplicate symbol 'google.pubsub.v1.__firstlineno__'

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

m4dm4rtig4n commented 1 week ago

It seems that the problem is global to several google libs. google-cloud-logging => https://github.com/googleapis/python-logging/issues/944

cdce8p commented 5 days ago

This is probably related to https://github.com/googleapis/proto-plus-python/issues/490