bazel-contrib / bazel-contrib/rules_python
FR: add PyInfo.direct_imports
- Lenguaje dominante
- Starlark
- Estrellas
- 688
- Forks
- 721
- Merge medio
- 15 h 7 min
- PR fusionados (30 d)
- 76
Descripción
Currently, the PyInfo's imports field returns all imports paths defined in a target, combined with the ones from its transitive dependencies, as defined here
There's no way to retrieve the direct import paths. It would be useful for IDE support, where we typically read data about a large number of targets and dependencies between them. In that case, we pessimistically would end up in n^2 import entries when reading that, because of depset expansion.
Alternatively IDEs could read just direct_imports and deps fields, and map them to their internal graph. Full transitive imports could still be resolved on demand, based on deps
What underlying problem are you trying to solve with this feature?
Avoid depset flattening when reading both imports and deps from PyInfo, according to https://bazel.build/rules/performance#avoid-depset-to-list
(originally from https://github.com/bazelbuild/bazel/issues/20449 by @tpasternak )
Guía de contribución
Línea de trabajo
Comienza localizando el proveedor PyInfo y los campos imports y deps existentes; después, lee las indicaciones enlazadas de Bazel sobre cómo evitar la conversión de depset-to-list. Se considera terminado cuando se expongan las rutas de importación directas sin aplanar las dependencias transitivas, preservando el comportamiento existente de los imports transitivos; el issue no especifica ningún archivo ni prueba concretos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- build-system
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100