bazel-contrib / bazel-contrib/rules_python

Make py_wheel warn if BUILD (or other special bazel files) are included

Ouverte
#3,033 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
type: feature request type: pip
Langage dominant
Starlark
Étoiles
688
Forks
721
Merge moyen
15 h 7 min
PR mergées (30 j)
76

Description

We've seen there are wheels that have special bazel build-time artifacts in them, which then interfere with the pip integration. While we should remove these upon consuming a wheel to prevent the problem, the wheels also shouldn't have those files in them to begin with.

Something I wonder is _how_ those files are ending up in wheels? My guess is just naive `glob("**")` somewhere. We can't control other tools to create wheels, but at the least, we can change py_wheel to error or fail if such special files occur.

Hm, I wonder if we could query pypi to see how often the metadata `Generator` value indicates our py_wheel was used.

Special files:

* BUILD
* BUILD.bazel
* WORKSPACE
* WORKSPACE.bazel
* REPO.bazel
* MODULE.bazel
* Auto-generated `__init__.py` files

I include auto-generated init files because I've seen a few wheels (nvidia-something) that had empty `__init__.py` files in places they shouldn't be or made no sense. (they use namespace packages, so such empty init files break things).

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start by tracing the py_wheel entry point to determine how wheel contents are assembled and where existing validation could run. Clarify whether the expected behavior is a warning or failure, then cover the listed Bazel files and inappropriate auto-generated __init__.py files; done means the intended cases are detected without disrupting valid wheels.

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é
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.