Skip to content

Allow package name to be customized via a generator option #605

Closed
@busunkim96

Description

@busunkim96

@property
def warehouse_package_name(self) -> str:
"""Return the appropriate Python package name for Warehouse."""
# Piece the name and namespace together to come up with the
# proper package name.
answer = list(self.namespace) + self.name.split(' ')
return '-'.join(answer).lower()

Occasionally we want to deviate from the generated provided api.naming.warehouse_package_name.

  • The published package includes two GAPICs (firestore admin and firestore) and we want the library to be consistently named google-cloud-firestore.
  • The API has a long name and we want to rename the package to make it easier to spell.
    google-cloud-assuredworkloads -> google-cloud-assured-workloads.

The name is used to identify the library in request headers so it is somewhat important.

DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
'{{ api.naming.warehouse_package_name }}',
).version,
)

CC @crwilcox

Metadata

Metadata

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions