Skip to content

chore(handwritten): centralize mypy configuration and update handwritten package noxfiles - #17409

Merged
chalmerlowe merged 28 commits into
mainfrom
feat/centralize-mypy-handwritten
Jul 21, 2026
Merged

chore(handwritten): centralize mypy configuration and update handwritten package noxfiles#17409
chalmerlowe merged 28 commits into
mainfrom
feat/centralize-mypy-handwritten

Conversation

@chalmerlowe

@chalmerlowechalmerlowe commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
  • Relies on a centralized mypy.ini file at the root of the repository to consolidate all shared and package-specific mypy exceptions.
  • Deletes the individual mypy.ini files from handwritten libraries, establishing the root configuration as the source of truth.
  • Refactored their noxfile.py files to define MYPY_CONFIG_FILE dynamically and standardized their session.run("mypy", ...) invocations.

Note

Due to test failures outside the scope of this PR, neither google-cloud-crc32c nor bigframes are included in this PR. This issue tracks those packages to ensure their eventual completion

Note

bigquery and spanner were pulled out and placed in separate PRs due to excessive duration of their tests. PR #17640 and PR #17641

Note

Work on generated libraries is outside the scope of this PR and can be found here: #17408

Note

UPDATE (20260706): This PR is no longer blocked by #17607

@gemini-code-assistgemini-code-assistBot 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 consolidates multiple package-specific mypy.ini configuration files into a single, centralized mypy.ini at the root directory, and updates the noxfile.py files across various packages to reference this central configuration. The reviewer pointed out that setting a global python_version = 3.14 in the centralized configuration and overriding it in individual packages can lead to inconsistent configurations, suggesting that shared configurations should be applied consistently.

Comment threadmypy.ini Outdated
@chalmerlowe
chalmerloweforce-pushed the feat/centralize-mypy-handwritten branch from 3a99b94 to 1afd309CompareJune 9, 2026 19:19
chalmerlowe added a commit that referenced this pull request Jun 16, 2026
…-cloud-datastore POC (#17408)
> [!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 remaining **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.
* Removes `mypy.ini` replacements from `datastore-integration.yaml`
post-processing.
* Regenerates `google-cloud-datastore` using the updated generator
configurations to serve as a proof of concept.
> [!note]
> Work on strictly handwritten libraries is outside the scope of this PR
and can be found here:
#17409
@chalmerlowe
chalmerloweforce-pushed the feat/centralize-mypy-handwritten branch from 3a08f78 to 4854f7eCompareJune 17, 2026 13:55
@chalmerlowechalmerlowe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 17, 2026
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 17, 2026
Comment threadpackages/bigquery-magics/mypy.ini Outdated

@chalmerlowechalmerloweJun 23, 2026

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

The bigquery-magics package does not support type-hinting, so there is no change to the noxfile at this time.

Comment threadmypy.ini Outdated
chalmerlowe added a commit that referenced this pull request Jun 23, 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 🦕
@chalmerlowe
chalmerloweforce-pushed the feat/centralize-mypy-handwritten branch from 4b18dbc to 8e35192CompareJune 25, 2026 18:49
chalmerlowe added a commit that referenced this pull request Jun 25, 2026
…-cloud-datastore POC (#17408)
> [!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 remaining **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.
* Removes `mypy.ini` replacements from `datastore-integration.yaml`
post-processing.
* Regenerates `google-cloud-datastore` using the updated generator
configurations to serve as a proof of concept.
> [!note]
> Work on strictly handwritten libraries is outside the scope of this PR
and can be found here:
#17409
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 🦕
@chalmerlowe
chalmerloweforce-pushed the feat/centralize-mypy-handwritten branch from 8e35192 to 1598b24CompareJune 25, 2026 21:53
@chalmerlowe
chalmerlowe marked this pull request as ready for review June 30, 2026 17:06
@chalmerlowe
chalmerlowe requested review from a team as code ownersJune 30, 2026 17:06
@chalmerlowe
chalmerlowe requested review from GarrettWu and removed request for a teamJune 30, 2026 17:06
@chalmerlowe
chalmerlowe marked this pull request as draft June 30, 2026 17:21
shuoweil added a commit that referenced this pull request Jun 30, 2026
@chalmerlowe
chalmerloweforce-pushed the feat/centralize-mypy-handwritten branch from 3ac9c56 to 9214a56CompareJuly 6, 2026 19:08
chalmerlowe added a commit that referenced this pull request Jul 8, 2026
* Relies on a centralized `mypy.ini` file at the root of the repository
to consolidate all shared and package-specific mypy exceptions.
* Deletes the individual `mypy.ini` files from handwritten libraries,
establishing the root configuration as the source of truth.
* Refactored their `noxfile.py` files to define `MYPY_CONFIG_FILE`
dynamically and standardized their `session.run("mypy", ...)`
invocations.
Related to: PR #17409 and PR #17641
> [!note]
> all three PRs rely on the same centralized mypy.ini config. So you may
see some minor edits in the main config that are applicable to packages
in one of the other PRs. This will have no effect on those packages
until their noxfiles are updated to begin using the new centralized
config.
@chalmerlowe
chalmerlowe marked this pull request as ready for review July 9, 2026 16:01
@chalmerlowe
chalmerlowe requested review from a team as code ownersJuly 9, 2026 16:01
@chalmerlowechalmerlowe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 17, 2026
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 17, 2026
@chalmerlowe
chalmerlowe merged commit b2d3fb9 into mainJul 21, 2026
120 of 121 checks passed
@chalmerlowe
chalmerlowe deleted the feat/centralize-mypy-handwritten branch July 21, 2026 17:25
copybara-serviceBot pushed a commit to google/bigframes that referenced this pull request Aug 12, 2026
…… (#17602)
This reverts PR:
googleapis/google-cloud-python#17409
Fixes #<issue_number_goes_here> 🦕
GitOrigin-RevId: 1f93a2b881bce80222ea71bb38adca94195fb0ae
Change-Id: I2716ba7cfdc0bbd67ebce348ad98002659eda4e7
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@chalmerlowe@daniel-sanche@yoshi-kokoro