gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

Generate non-empty `/services/__init__.py` file

Open BenRKarl opened this issue 9 months ago • 0 comments

Thanks for stopping by to let us know something could be better!

Is your feature request related to a problem? Please describe.

In the Google Ads API we have a number of types that are defined within the service protos, and these types are difficult to import without knowing the name of the file they're defined in. So having a top-level init.py file with each type listed helps with our import logic. We had a similar mechanism in the old Ads templates.

Currently we work around this by manually copying the init.py file under /services/types into /services/ and appending .types to the import paths (see current file)

Describe the solution you'd like

It would be great if this __init__.py file under /services/ was generated automatically.

Describe alternatives you've considered

I considered updating our get_type method logic to handle this inconsistency, but it doesn't seem to work when the /services/__init__.py file is empty.

Additional context Add any other context or screenshots about the feature request here.

BenRKarl avatar Mar 19 '25 14:03 BenRKarl