bazel-contrib / bazel-contrib/rules_python
FR: add PyInfo.direct_imports
- Langage dominant
- Starlark
- Étoiles
- 688
- Forks
- 721
- Merge moyen
- 15 h 7 min
- PR mergées (30 j)
- 76
Description
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 )
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par localiser le provider PyInfo et les champs imports et deps existants, puis lisez les indications Bazel liées sur la manière d’éviter la conversion depset-to-list. Le travail est considéré comme terminé lorsque les chemins d’importation directs sont exposés sans aplatir les dépendances transitives, tout en préservant le comportement existant des imports transitifs ; aucun fichier ni test précis n’est indiqué dans l’issue.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- build-system
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100