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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto-plus >= 1.25 needed for python 3.13 #944

Closed
johncarter-phntm opened this issue Oct 9, 2024 · 3 comments · Fixed by #955
Closed

proto-plus >= 1.25 needed for python 3.13 #944

johncarter-phntm opened this issue Oct 9, 2024 · 3 comments · Fixed by #955
Assignees
Labels
api: logging Issues related to the googleapis/python-logging API.

Comments

@johncarter-phntm
Copy link

johncarter-phntm commented Oct 9, 2024

Environment details

  • OS type and version: Debian Bookworm / Docker
  • Python version: python --version 3.13.0
  • pip version: pip --version 24.2
  • google-cloud-logging version: pip show google-cloud-logging
Name: google-cloud-logging
Version: 3.11.2
Summary: Stackdriver Logging API client library
Home-page: https://github.com/googleapis/python-logging
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: /usr/local/lib/python3.13/site-packages
Requires: google-api-core, google-auth, google-cloud-appengine-logging, google-cloud-audit-log, google-cloud-core, grpc-google-iam-v1, opentelemetry-api, proto-plus, protobuf
Required-by: 

Steps to reproduce

  1. docker run -it python:3.13.0 bash
  2. pip install google-cloud-logging
  3. python -c "import google.cloud.logging"

Code example

import google.cloud.logging

Stack trace

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import google.cloud.logging
  File "/usr/local/lib/python3.13/site-packages/google/cloud/logging/__init__.py", line 18, in <module>
    from google.cloud.logging_v2 import __version__
  File "/usr/local/lib/python3.13/site-packages/google/cloud/logging_v2/__init__.py", line 21, in <module>
    from google.cloud.logging_v2.client import Client
  File "/usr/local/lib/python3.13/site-packages/google/cloud/logging_v2/client.py", line 25, in <module>
    from google.cloud.logging_v2._helpers import _add_defaults_to_filter
  File "/usr/local/lib/python3.13/site-packages/google/cloud/logging_v2/_helpers.py", line 31, in <module>
    from google.cloud.logging_v2.types import LogSeverity
  File "/usr/local/lib/python3.13/site-packages/google/cloud/logging_v2/types/__init__.py", line 36, in <module>
    from .logging_config import (
    ...<53 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/google/cloud/logging_v2/types/logging_config.py", line 2403, in <module>
    class LocationMetadata(proto.Message):
    ...<11 lines>...
        )
  File "/usr/local/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 "/usr/local/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.logging.v2.__firstlineno__'
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label Oct 9, 2024
@cdce8p
Copy link

cdce8p commented Oct 13, 2024

This is probably related to googleapis/proto-plus-python#490

@johncarter-phntm
Copy link
Author

This is probably related to googleapis/proto-plus-python#490

Agreed - proto-plus>=1.25.0rc0 seems to fix the issue for me 👍

@parthea parthea changed the title Import error on Python 3.13 TypeError: Couldn't build proto file into descriptor pool: duplicate symbol 'google.logging.v2.__firstlineno__'" proto-plus >= 1.25 needed for python 3.13 Oct 25, 2024
@parthea
Copy link
Contributor

parthea commented Oct 25, 2024

The setup.py file should be updated to require proto-plus >= 1.25 for python_version >=3.13 due to googleapis/proto-plus-python#490

See release notes here: https://github.com/googleapis/proto-plus-python/releases/tag/v1.25.0

Add "proto-plus >= 1.25.0, <2.0.0dev; python_version>='3.13'", after the following line

"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",

As an example, see googleapis/python-api-core#740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/python-logging API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants