googleapis / googleapis/google-cloud-python

`py.typed` but no type annotations

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

説明

`google.cloud.logging_v2 contains` a `py.typed` file but the package does not provide type annotations.

Hence, code like this:

```py
from google.cloud.logging import Client
from google.cloud.logging.handlers import CloudLoggingHandler
from google.cloud.logging_v2.handlers.handlers import setup_logging

client = Client()
handler = CloudLoggingHandler(client)
setup_logging(handler)
```

will trigger this error in Pyright:

```
test.py:3:55 - error: Type of "setup_logging" is partially unknown
  Type of "setup_logging" is "(handler: Unknown, *, excluded_loggers: Unknown = EXCLUDED_LOGGER_DEFAULTS, log_level: int = logging.INFO) -> None" (reportUnknownVariableType)
```

My interpretation of the meaning of `py.typed` is "this package has type annotations that should be use by the type checker for code importing this package".

Is there any plan to provide type annotations?

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

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

評価

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

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

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