googleapis / googleapis/google-cloud-python

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

オープン
#16,231 コメント 1 件 リアクション 0 件 担当者 1 名 @ohmayr が担当を希望しています GitHub で見る
priority: p2 type: feature request
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
122

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。