googleapis / googleapis/google-cloud-python

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

Offen
#16,231 1 Kommentar 0 Reaktionen 1 zugewiesene Person Beansprucht von @ohmayr Auf GitHub ansehen
priority: p2 type: feature request
Vorherrschende Sprache
Python
Sterne
5.4k
Forks
1.8k
Ø Merge
3 T. 4 Std.
Gemergte PRs (30 T.)
122

Beschreibung

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](https://github.com/googleads/google-ads-python/blob/6c205c4abdf95a18c70b938e37f448660b280da9/google/ads/googleads/v18/__init__.py) in the old Ads templates.

Currently we work around this by manually copying the [__init__.py file under `/services/types`](https://github.com/googleads/google-ads-python/blob/main/google/ads/googleads/v19/services/types/__init__.py) into `/services/` and appending `.types` to the import paths (see [current file](https://github.com/googleads/google-ads-python/blob/main/google/ads/googleads/v19/services/__init__.py))

**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](https://github.com/googleads/google-ads-python/blob/main/google/ads/googleads/client.py#L410) 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.