Enable full type checking on search engine

Now it utilize type stub for PySocks library and all search engine python code are properly
type checked.

Note that a `cast` is required because there isn't enough hints in PySocks to let the type
checker understand that the classes are supposed to be compatible.

PR #23183.
This commit is contained in:
Chocobo1
2025-08-31 22:10:30 +08:00
committed by GitHub
parent dffd27a879
commit becfd19e34
2 changed files with 11 additions and 8 deletions

View File

@@ -69,9 +69,12 @@ jobs:
- name: Check typings (search engine)
run: |
curl \
-L \
-o src/searchengine/nova3/socks.pyi "https://github.com/python/typeshed/raw/refs/heads/main/stubs/PySocks/socks.pyi"
MYPYPATH="src/searchengine/nova3" \
mypy \
--follow-imports skip \
--explicit-package-bases \
--strict \
$PY_FILES
pyright \