googleapis / googleapis/google-cloud-python

Type safety issues

オープン
#14,148 コメント 0 件 リアクション 1 件 担当者 1 名 @nidhiii-27 が担当を希望しています GitHub で見る
api: storage priority: p3 type: bug
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。