Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions google/api_core/_python_version_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@

import datetime
import enum
import logging
import warnings
import sys
import textwrap
from typing import Any, List, NamedTuple, Optional, Dict, Tuple


_LOGGER = logging.getLogger(__name__)


class PythonVersionStatus(enum.Enum):
"""Support status of a Python version in this client library artifact release.

Expand Down Expand Up @@ -168,11 +172,14 @@ def _get_pypi_package_name(module_name):
if module_name in module_to_distributions: # pragma: NO COVER
# The value is a list of distribution names, take the first one
return module_to_distributions[module_name][0]
else:
return None # Module not found in the mapping
except Exception as e:
print(f"An error occurred: {e}")
return None
_LOGGER.info(
"An error occurred while determining PyPI package name for %s: %s",
module_name,
e,
)

return None


def _get_distribution_and_import_packages(import_package: str) -> Tuple[str, Any]:
Expand Down