Skip to content

ci: speedup type checking - #5982

Merged
Bobronium merged 2 commits into
mainfrom
arseny/cache-mypy-on-ci
Jun 10, 2026
Merged

ci: speedup type checking#5982
Bobronium merged 2 commits into
mainfrom
arseny/cache-mypy-on-ci

Conversation

@Bobronium

@Bobronium Bobronium commented Jun 5, 2026

Copy link
Copy Markdown
Member

This speeds up mypy from 2m 42s to just 3s with cache (whole job succeeds in 30 seconds instead of 3.5 minutes).

Changes

  • Move typing stubs to typing dependency group
  • Update scripts/check_types.py to recognize missing typing dependencies from a single run and suggest adding them
  • Add cache layer on GitHub Actions

Running scripts/check_types.py with missing dependencies will now produce:

check_types: mypy needs type stubs that aren't currently installed.

Make sure to add them to the `typing` group and lock them with:

    uv add --group typing types-openpyxl types-python-dateutil types-xlrd

Bobronium and others added 2 commits June 10, 2026 00:43
Declare third-party stubs in a dedicated `typing` dependency group locked
in uv.lock, and add it to default-groups. check_types.py now runs a single
deterministic mypy pass via `uv run --group typing`, and on failure reads
mypy's `.mypy_cache/missing_stubs` to print the exact `uv add` command for
any stubs that still need declaring. This drops the pip + `--install-types`
forward pass that doubled runtime.

Co-Authored-By: Claude <noreply@anthropic.com>
@Bobronium
Bobronium force-pushed the arseny/cache-mypy-on-ci branch from d5c7c3b to aa249d4 Compare June 10, 2026 00:44
@Bobronium Bobronium changed the title ci: add cache for mypy ci: speedup type checking Jun 10, 2026
@Bobronium
Bobronium marked this pull request as ready for review June 10, 2026 01:21
@chenghao-mou
chenghao-mou requested a review from a team June 10, 2026 01:21

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread scripts/check_types.py
@Bobronium
Bobronium merged commit a4e8680 into main Jun 10, 2026
33 checks passed
@Bobronium
Bobronium deleted the arseny/cache-mypy-on-ci branch June 10, 2026 02:29
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.

2 participants