-
Notifications
You must be signed in to change notification settings - Fork 289
examples: fix mypy errors in example entry points; add local type-check script (#1091) #1248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7309315
examples: fix mypy errors across example entry points; add helper scr…
samojavo 10dfdd8
examples: review follow-up cleanup (simplify types, restore decorator…
samojavo 3705fa1
comment fix
samojavo d783678
examples: review fixes\n- image_search/main: use CLIP_MODEL_DIMENSION…
samojavo ad5d369
examples: apply ruff formatting
samojavo 869b248
image_search mypy fix
samojavo f520e1c
fixes in face_recognition and postgres_source
samojavo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| # Resolve python in local venv | ||
| $repoRoot = Split-Path -Parent $PSScriptRoot | ||
| $python = Join-Path $repoRoot '.venv\Scripts\python.exe' | ||
| if (-not (Test-Path $python)) { | ||
| $python = 'python' | ||
| } | ||
|
|
||
| # Ensure mypy can resolve local cocoindex package sources | ||
| $env:MYPYPATH = Join-Path $repoRoot 'python' | ||
|
|
||
| # Collect example entry files | ||
| $examples = Join-Path $repoRoot 'examples' | ||
| $files = Get-ChildItem -Path $examples -Recurse -File | | ||
| Where-Object { $_.Name -in @('main.py','colpali_main.py') } | | ||
| Sort-Object FullName | ||
|
|
||
| $failed = @() | ||
| foreach ($f in $files) { | ||
| Write-Host (">>> Checking " + $f.FullName) | ||
| & $python -m mypy --ignore-missing-imports --follow-imports=silent $f.FullName | ||
| if ($LASTEXITCODE -ne 0) { | ||
| $failed += $f.FullName | ||
| } | ||
| } | ||
|
|
||
| if ($failed.Count -gt 0) { | ||
| Write-Host "\nFailures:" | ||
| $failed | ForEach-Object { Write-Host $_ } | ||
| exit 1 | ||
| } else { | ||
| Write-Host "\nAll example entry files passed mypy." | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
# type: ignorehere too, instead of acast.