googleapis / googleapis/google-cloud-python

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

未关闭
#16,231 1 条评论 0 个 reaction 已指派 1 人 已被 @ohmayr 认领 在 GitHub 查看
priority: p2 type: feature request
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
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 摘要。