Skip to content

feat(mypy): centralize mypy.ini and update templates#17523

Merged
chalmerlowe merged 2 commits into
mainfrom
feat/centralize-mypy-v3
Jun 23, 2026
Merged

feat(mypy): centralize mypy.ini and update templates#17523
chalmerlowe merged 2 commits into
mainfrom
feat/centralize-mypy-v3

Conversation

@chalmerlowe

Copy link
Copy Markdown
Contributor

Note

This is step one of a multi-step process. The work done here is outlined below.
Additional steps (to be completed in other PRs) include:

  • generate the generated packages
  • generate and/or post process hybrid packages

This work:

  • Adds a centralized mypy.ini file at the root of the repository.
  • Updates GAPIC generator templates to omit local mypy.ini and dynamically resolve the root config via a MYPY_CONFIG_FILE constant.

Note

Work on strictly handwritten libraries is outside the scope of this PR and can be found here: #17409

Partially resolves: #17322 🦕

> [!note]
> This is step one of a multi-step process. The work done here is outlined below.
Additional steps (to be completed in other PRs) include:
> * generate the **generated packages**
> * generate and/or post process **hybrid packages**

This work:
* Adds a centralized `mypy.ini` file at the root of the repository.
* Updates GAPIC generator templates to omit local `mypy.ini` and dynamically resolve the root config via a `MYPY_CONFIG_FILE` constant.

> [!note]
> Work on strictly handwritten libraries is outside the scope of this PR and can be found here: #17409

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request centralizes the mypy configuration by introducing a single mypy.ini at the repository root, removing individual package-level configurations, and updating the template and generated noxfile.py files to reference the centralized configuration. It also fixes a bug in the golden update script within integration_test.bzl. The reviewer feedback points out that the hardcoded relative path to mypy.ini will fail for integration test goldens, which are located deeper in the directory structure, and suggests dynamically searching upwards through parent directories to locate the configuration file.

Comment thread packages/gapic-generator/gapic/templates/noxfile.py.j2 Outdated
Comment thread packages/gapic-generator/gapic/ads-templates/noxfile.py.j2 Outdated
@chalmerlowe chalmerlowe marked this pull request as ready for review June 23, 2026 17:19
@chalmerlowe chalmerlowe requested a review from a team as a code owner June 23, 2026 17:19
@chalmerlowe chalmerlowe added the automerge Merge the pull request once unit tests and other checks pass. label Jun 23, 2026
@chalmerlowe chalmerlowe merged commit 3a67b7f into main Jun 23, 2026
98 checks passed
@chalmerlowe chalmerlowe deleted the feat/centralize-mypy-v3 branch June 23, 2026 18:01
@release-please release-please Bot mentioned this pull request Jun 23, 2026
chalmerlowe added a commit that referenced this pull request Jun 25, 2026
> [!note]
> This is step one of a multi-step process. The work done here is
outlined below.
Additional steps (to be completed in other PRs) include:
> * generate the **generated packages**
> * generate and/or post process **hybrid packages**

This work:
* Adds a centralized `mypy.ini` file at the root of the repository.
* Updates GAPIC generator templates to omit local `mypy.ini` and
dynamically resolve the root config via a `MYPY_CONFIG_FILE` constant.

> [!note]
> Work on strictly handwritten libraries is outside the scope of this PR
and can be found here:
#17409

Partially resolves: #17322 🦕
parthea pushed a commit that referenced this pull request Jun 25, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>gapic-generator: 1.36.0</summary>

##
[1.36.0](gapic-generator-v1.35.0...gapic-generator-v1.36.0)
(2026-06-25)


### Features

* **mypy:** centralize mypy.ini and update templates
([#17523](#17523))
([3a67b7f](3a67b7f))
</details>

<details><summary>google-ads-datamanager: 0.9.1</summary>

##
[0.9.1](google-ads-datamanager-v0.9.0...google-ads-datamanager-v0.9.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-analytics-admin: 0.30.1</summary>

##
[0.30.1](google-analytics-admin-v0.30.0...google-analytics-admin-v0.30.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-apps-chat: 0.10.1</summary>

##
[0.10.1](google-apps-chat-v0.10.0...google-apps-chat-v0.10.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-auth: 2.55.1</summary>

##
[2.55.1](google-auth-v2.55.0...google-auth-v2.55.1)
(2026-06-25)


### Bug Fixes

* **auth:** lower regional access boundary logs from warning to debug.
([#17571](#17571))
([1ef4183](1ef4183)),
closes
[#17515](#17515)
</details>

<details><summary>google-cloud-bigtable: 2.40.0</summary>

##
[2.40.0](google-cloud-bigtable-v2.39.0...google-cloud-bigtable-v2.40.0)
(2026-06-25)


### Features

* regenerate google-cloud-bigtable
([#17575](#17575))
([bd782cf](bd782cf))


### Bug Fixes

* **bigtable:** populate Value type in _format_execute_query_view_params
([#17547](#17547))
([8cb77d9](8cb77d9))
</details>

<details><summary>google-cloud-build: 3.38.0</summary>

##
[3.38.0](google-cloud-build-v3.37.0...google-cloud-build-v3.38.0)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-ces: 0.7.1</summary>

##
[0.7.1](google-cloud-ces-v0.7.0...google-cloud-ces-v0.7.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-chronicle: 0.6.1</summary>

##
[0.6.1](google-cloud-chronicle-v0.6.0...google-cloud-chronicle-v0.6.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-compute: 1.49.0</summary>

##
[1.49.0](google-cloud-compute-v1.48.0...google-cloud-compute-v1.49.0)
(2026-06-25)


### Features

* regenerate google-cloud-compute
([#17576](#17576))
([140d86f](140d86f))
</details>

<details><summary>google-cloud-dataform: 0.11.1</summary>

##
[0.11.1](google-cloud-dataform-v0.11.0...google-cloud-dataform-v0.11.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-dataproc: 5.29.0</summary>

##
[5.29.0](google-cloud-dataproc-v5.28.0...google-cloud-dataproc-v5.29.0)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-dialogflow: 2.49.0</summary>

##
[2.49.0](google-cloud-dialogflow-v2.48.0...google-cloud-dialogflow-v2.49.0)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-dialogflow-cx: 2.7.0</summary>

##
[2.7.0](google-cloud-dialogflow-cx-v2.6.0...google-cloud-dialogflow-cx-v2.7.0)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-discoveryengine: 0.20.1</summary>

##
[0.20.1](google-cloud-discoveryengine-v0.20.0...google-cloud-discoveryengine-v0.20.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-firestore: 2.28.0</summary>

##
[2.28.0](google-cloud-firestore-v2.27.0...google-cloud-firestore-v2.28.0)
(2026-06-25)


### Features

* **firestore:** drop Python 3.7-3.9 support and regenerate
([#17247](#17247))
([b11224f](b11224f))
* regenerate google-cloud-[e-i] packages
([#17079](#17079))
([5239b18](5239b18))
* regenerate google-cloud-firestore
([#17577](#17577))
([57ebaa3](57ebaa3))


### Bug Fixes

* **firestore:** Imropve improper pipeline aliases
([#16651](#16651))
([f728bd6](f728bd6))
* **firestore:** remove usage of typing_extensions
([#17357](#17357))
([cdaf213](cdaf213))
* make test_utils unique_resource_id parallel-safe
([#17440](#17440))
([ac1f5d5](ac1f5d5))
</details>

<details><summary>google-cloud-network-management: 1.37.0</summary>

##
[1.37.0](google-cloud-network-management-v1.36.0...google-cloud-network-management-v1.37.0)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-network-security: 0.13.2</summary>

##
[0.13.2](google-cloud-network-security-v0.13.1...google-cloud-network-security-v0.13.2)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-network-services: 0.10.1</summary>

##
[0.10.1](google-cloud-network-services-v0.10.0...google-cloud-network-services-v0.10.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-oracledatabase: 0.6.1</summary>

##
[0.6.1](google-cloud-oracledatabase-v0.6.0...google-cloud-oracledatabase-v0.6.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

<details><summary>google-cloud-spanner: 3.69.0</summary>

##
[3.69.0](google-cloud-spanner-v3.68.0...google-cloud-spanner-v3.69.0)
(2026-06-25)


### Features

* regenerate google-cloud-spanner
([#17578](#17578))
([39b252f](39b252f))
</details>

<details><summary>google-cloud-vectorsearch: 0.11.1</summary>

##
[0.11.1](google-cloud-vectorsearch-v0.11.0...google-cloud-vectorsearch-v0.11.1)
(2026-06-25)


### Features

* update googleapis and regenerate
([#17554](#17554))
([03d0574](03d0574))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Merge the pull request once unit tests and other checks pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move mypy.ini to the monorepo root.

2 participants