Skip to content

Update mypy presubmits for generated clients to use --strict option #16291

@parthea

Description

@parthea

Mypy has a --strict option. We should update the mypy tests for generated clients from mypy -p google to mypy -p --strict google

https://github.com/googleapis/gapic-generator-python/blob/1b63310378692f478ef29734b3cb5fde3d436b22/gapic/templates/noxfile.py.j2#L186-L194

There is some guidance here for setting stricter options.

An excellent goal to aim for is to have your codebase pass when run against mypy --strict. This basically ensures that you will never have a type related error without an explicit circumvention somewhere (such as a # type: ignore comment).

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: cleanupAn internal cleanup or hygiene concern.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions