Make type checking mypy more straightforward for new contributors
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 20.6k
- Forks
- 3.3k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
There are a couple pitfalls relating to type checking mypy itself that don't seem to be documented anywhere:
- Specifying files: Running
mypy .andmypy mypy mypycboth result in duplicate module errors that prevent further type checking. The correct way to run mypy ismypy -p mypy -p mypyc, which doesn't appear to be documented anywhere (I only found this by looking at the tox.ini config file). - Specifying the config file: Failing to specify mypy_self_check.ini as the config file results in an error in mypy/bogus_type.py and means that people aren't using mypy's stricter type checking options.
I think the solution to 2 would be to rename mypy_self_check.ini to mypy.ini, because self checking mypy is significantly more common than compiling mypy with mypyc, so making mypy_self_check.ini the default config file seems reasonable.
For 1, we should at the very least document the command to run mypy in CONTRIBUTING.md. I think the ideal solution would involve changing the configuration file so that either mypy . or mypy mypy mypyc just works correctly, the latter of which seems to be possible from my experiments by turning on namespace_packages and excluding mypyc/test-data.
Guía de contribución
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.
Línea de trabajo
Comienza con CONTRIBUTING.md y tox.ini para comparar los comandos de mypy documentados y configurados. Inspecciona mypy_self_check.ini y mypy/bogus_type.py; después, verifica si los cambios propuestos en los nombres de configuración o en los namespace packages evitan los errores de módulos duplicados y mantienen una comprobación automática estricta. Se considera completado cuando el flujo de trabajo para contribuyentes documenta un comando y una configuración fiables.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- build-system, developer-experience, documentation
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100