Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

mypy: add moto-ext as additional-dependencies in pre-commit hook#13465

Merged
bentsku merged 3 commits intomainfrom
transcribe-ignore-import
Dec 4, 2025
Merged

mypy: add moto-ext as additional-dependencies in pre-commit hook#13465
bentsku merged 3 commits intomainfrom
transcribe-ignore-import

Conversation

@bentsku
Copy link
Copy Markdown
Contributor

@bentsku bentsku commented Dec 4, 2025

Motivation

Locally, when running mypy on the transcribe service, we might get the following failure since #13433:

mypy.......................................................................Failed
- hook id: mypy
- exit code: 1

localstack/services/transcribe/provider.py:106: error: Cannot find implementation or library stub for module named "moto.transcribe.models"  [import-not-found]
localstack/services/transcribe/provider.py:106: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 14 source files)

I had encountered the issue in the PR introducing this import locally, but when adding the type ignore so that it would work, it started failing in CI saying that the type ignore was useless so I removed it. See 3e1ff49

This is because locally, we did not declare moto-ext as an additional-dependencies for the pre-commit hook

\cc @silv-io
\cc @bblommers you might have an idea about why we'd get such error, with your experience of mypy? I have trouble making sense of the error message

Changes

  • add moto-ext to the list of additional dependencies in the pre-commit hook

Tests

  • check out the branch, run the pre-commit and see that it works

Related

@bentsku bentsku added this to the 4.12 milestone Dec 4, 2025
@bentsku bentsku self-assigned this Dec 4, 2025
@bentsku bentsku added semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Dec 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 4, 2025

Test Results - Preflight, Unit

22 889 tests  ±0   21 075 ✅ ±0   6m 21s ⏱️ -2s
     1 suites ±0    1 814 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 8417f24. ± Comparison against base commit b8e33ce.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 4, 2025

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 55m 53s ⏱️ +27s
5 121 tests ±0  4 729 ✅ ±0  392 💤 ±0  0 ❌ ±0 
5 123 runs  ±0  4 729 ✅ ±0  394 💤 ±0  0 ❌ ±0 

Results for commit 8417f24. ± Comparison against base commit b8e33ce.

♻️ This comment has been updated with latest results.

@bentsku bentsku changed the title transcribe: add type ignore for moto import mypy: add moto-ext as additional-dependencies in pre-commit hook Dec 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 4, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   2m 58s ⏱️ -4s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 8417f24. ± Comparison against base commit b8e33ce.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 4, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   2h 32m 10s ⏱️
5 495 tests 4 943 ✅ 552 💤 0 ❌
5 501 runs  4 943 ✅ 558 💤 0 ❌

Results for commit 8417f24.

Copy link
Copy Markdown
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

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

Checked it out locally, it works!

@bentsku bentsku marked this pull request as ready for review December 4, 2025 15:23
@bentsku bentsku merged commit 53d7108 into main Dec 4, 2025
45 checks passed
@bentsku bentsku deleted the transcribe-ignore-import branch December 4, 2025 15:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants