Complete library typing and enforce mypy strict in CI
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza reproduciendo la línea base exclusiva de la biblioteca con el checkout fijado y mypy --strict, separando los ocho paquetes de la biblioteca del cliente de validación generado. Revisa las exportaciones faltantes, las anotaciones incompletas, las llamadas sin tipos y los argumentos genéricos faltantes que se hayan informado; después, comprueba si los wheels instalados contienen py.typed y revisa los imports de los consumidores. Se considera terminado cuando los ocho paquetes superan las comprobaciones estrictas en CI, los wheels tipados admiten comprobaciones representativas de consumidores y las pruebas de ejecución existentes siguen pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi! I use LLMs to help write code, and passing strict type checks such as mypy --strict is one of my guardrails. A project I'm working on depends on this library, so more complete type information would save me a lot of troubleshooting and help catch mistakes earlier.
Is your feature request related to a problem? Please describe.
The library already has substantial type annotations and runs mypy in CI. However, strict checking still exposes gaps that affect consumers. On the checkout described below, ordinary mypy passes, while mypy --strict reports 298 errors across the eight library packages.
For example, checking this consumer code with mypy --strict example.py reports implicit-export errors for both imports, an untyped call to get_key(), and an Any return:
from kiota_abstractions.serialization import Parsable
from kiota_http.middleware.options import RetryHandlerOption
def retry_option_key() -> str:
return RetryHandlerOption().get_key()
I also built the microsoft-kiota-bundle wheel locally and confirmed that it lacks py.typed. Mypy treats an installed import of kiota_bundle.default_request_adapter as untyped, despite the annotations in its source.
Describe the solution you'd like
Complete the existing typing support and enforce strict mypy checks for the library packages.
Suggested definition of done:
- All eight library source packages pass
mypy --strictin CI with a pinned mypy version across the supported Python versions. - Consumer checks against installed wheels verify public imports and representative inferred return types; all intended typed packages ship
py.typed. - Public types remain useful, with any necessary suppressions narrowly scoped and explained, rather than broadly replacing types with
Anyor disabling checks. - Existing runtime tests pass and public behavior remains compatible.
I suggest keeping unit-test typing and adopting another checker outside the initial scope. Recurring generated-code annotation changes could be tracked separately with the generator work they require.
Describe alternatives you've considered
Local stubs or per-project mypy overrides could work around individual problems, but would leave consumers maintaining those workarounds. Completing the shared library annotations would benefit dependent projects directly.
Additional context
- Checkout:
eef36d7e72197063f234b24407edad15ad873bea; local packages report version 1.12.1. - Environment: Linux, Python 3.13.5, mypy 2.3.1; dependencies installed using uv, with all eight packages installed in editable mode.
- The library-only baseline is 298 errors in 101 checked source files. The generated validation client adds 345 errors in 86 files; those are separate from the library count.
- The largest recurring library categories are missing explicit exports, incomplete function annotations, untyped calls, and missing generic arguments.
- Related earlier typing discussions: #355 and #333, both closed.
Would you be open to using strict mypy compliance as a tracked enhancement for the library packages?
- Lenguaje dominante
- Python
- Estrellas
- 31
- Forks
- 39
- Merge medio
- 16 h 37 min
- PR fusionados (30 d)
- 42
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/kiota-python
-
help wanted type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/kiota-python#477 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
microsoft/kiota-python#745 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
microsoft/kiota-python#744 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
microsoft/kiota-python#737 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
httpx python library issuesAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
microsoft/kiota-python#533 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/kiota-python
Issues similares
-
tool-calling
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
vllm-project/vllm#59838 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
raullenchai/Rapid-MLX#4042 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
transitmatters/mbta-slow-zone-bot#70 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
litestar-org/advanced-alchemy#811 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día