Avoid generating modules that conflict with builtin modules
A file logging.py exists in the generated client for google-cloud-logging in the directory google/cloud/logging_v2/types here.
It's not ideal to import the client using the statement from google.cloud.logging_v2.types import logging like we do here : https://github.com/googleapis/gapic-generator-python/blob/d87480974bf230647e77343f30b1c82a08773a03/tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/client.py#L42
The reason is that logging is also a built-in Python3 module, and from google.cloud.logging_v2.types import logging will clobber the built-in module logging.
See the error in https://github.com/googleapis/gapic-generator-python/actions/runs/12129001516/job/33816582330
___ ERROR collecting tests/unit/gapic/logging_v2/test_metrics_service_v2.py ____
tests/unit/gapic/logging_v2/test_metrics_service_v2.py:51: in <module>
from google.cloud.logging_v2.services.metrics_service_v2 import MetricsServiceV2AsyncClient
google/cloud/logging_v2/services/metrics_service_v2/__init__.py:16: in <module>
from .client import MetricsServiceV2Client
google/cloud/logging_v2/services/metrics_service_v2/client.py:23: in <module>
from google.cloud.logging_v2 import gapic_version as package_version
google/cloud/logging_v2/__init__.py:23: in <module>
from .services.logging_service_v2 import LoggingServiceV2Client
google/cloud/logging_v2/services/logging_service_v2/__init__.py:17: in <module>
from .async_client import LoggingServiceV2AsyncClient
google/cloud/logging_v2/services/logging_service_v2/async_client.py:51: in <module>
_LOGGER = logging.getLogger(__name__)
E AttributeError: module 'google.cloud.logging_v2.types.logging' has no attribute 'getLogger'
The fix is to ensure that we don't generate files which conflict with built-in modules. As an example, instead of logging.py, we could have types_logging.py