googleapis / googleapis/google-cloud-python

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

Đang mở
#16,231 1 bình luận 0 reaction 1 người được giao Được @ohmayr nhận Xem trên GitHub
priority: p2 type: feature request
Ngôn ngữ chính
Python
Star
5.4k
Fork
1.8k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
122

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.