googleapis / googleapis/google-cloud-python

Type safety issues

未关闭
#14,148 0 条评论 1 个 reaction 已指派 1 人 已被 @nidhiii-27 认领 在 GitHub 查看
api: storage priority: p3 type: bug
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

### Determine this is the right repository

- [x] I determined this is the correct repository in which to report this bug.

### Summary of the issue

Using VSCode or Cursor.ai editor, with everything set up (type checking strict, ruff linter and pyright) the project has
- no py.typed file
- Functions with no annotated return value
- no type stubs

Which means the editor complains and all code which touches this library is lit up red, making it hard to tell real issues from GCP python library issues.

Google has vast resources, they can afford to take due diligence and follow mainstream best practices in software development lifecycle, which includes making sure type safety works.

Please annotate your return types and make a py.typed file.

I am using python 3.13.4 and `google-cloud-storage==3.2.0`

### API client name and version

google-cloud-storage==3.2.0

### Reproduction steps: code

`.vscode/settings.json`

```json
{
"python.analysis.typeCheckingMode": "strict"
}
```

With the Python and Pylance extensions installed. Even the `pyrightconfig.json` does not help:

```json
{
"typeCheckingMode": "strict",
"pythonVersion": "3.13",
"analyzeUnannotatedFunctions": true,
"useLibraryCodeForTypes": true,
"reportMissingTypeStubs": false
}
```

### Reproduction steps: supporting files

-

### Reproduction steps: actual results

Already given

### Reproduction steps: expected results

I expect that libraries function with type safety and do not cause errors just by importing them.

### OS & version + platform

_No response_

### Python environment

3.13.4

### Python dependencies

$ pip freeze | grep -i google
google-api-core==2.25.1
google-auth==2.40.3
google-cloud-core==2.4.3
google-cloud-storage==3.2.0
google-crc32c==1.7.1
google-resumable-media==2.7.2
googleapis-common-protos==1.70.0

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。