Skip to content

feat: enable mypy session for documentai-toolbox#16690

Open
chalmerlowe wants to merge 1 commit intomainfrom
feat-enable-mypy-documentai-toolbox
Open

feat: enable mypy session for documentai-toolbox#16690
chalmerlowe wants to merge 1 commit intomainfrom
feat-enable-mypy-documentai-toolbox

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

This PR enables the mypy session in noxfile.py for documentai-toolbox and aligns it with the GAPIC generator template. Currently, it fails with 46 errors. This is pushed to allow farming out the work to resolve these errors or for separate review.

@chalmerlowe chalmerlowe requested a review from a team as a code owner April 16, 2026 14:42
Copy link
Copy Markdown
Contributor

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

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 implements the mypy type checking session in the noxfile.py, replacing a previous skip command. Feedback indicates that enabling this session immediately may cause CI failures due to existing type errors and recommends using a configuration file or adding error codes for better visibility. Additionally, the specified mypy version constraint was noted as referencing an unreleased version.

Comment on lines +490 to +497
session.run(
"mypy",
"-p",
"google.cloud.documentai_toolbox",
"--check-untyped-defs",
"--ignore-missing-imports",
*session.posargs,
)
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.

high

Enabling this session while it has 46 known errors will break the CI pipeline. To avoid blocking the build, consider keeping the session.skip() call until the errors are resolved, or providing a configuration file (e.g., mypy.ini) to ignore existing issues. Additionally, adding --show-error-codes is recommended to help categorize and fix the reported errors.

# Enable mypy once this bug is fixed.
session.skip("Temporarily skip mypy. See issue 16014")
session.install(
"mypy<1.16.0",
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.

medium

The version constraint mypy<1.16.0 references a version that has not yet been released (current stable is 1.14.x). Consider using a known stable version or a more standard range to ensure predictable behavior.

@chalmerlowe chalmerlowe self-assigned this Apr 16, 2026
Sign up for free to 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.

1 participant