googleapis / googleapis/google-cloud-python

`py.typed` but no type annotations

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