bazel-contrib / bazel-contrib/rules_python

Make py_wheel provide depset of files

Offen
#3,068 0 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
core-rules type: feature request
Vorherrschende Sprache
Starlark
Sterne
688
Forks
721
Ø Merge
15 Std. 7 Min.
Gemergte PRs (30 T.)
76

Beschreibung

The basic goal is to allow depending on a build-time generated wheel (i.e. `py_wheel` _without_ having to go through the zip/unzip process of creating a wheel archive. Wheels may be large in size, so the process of staging, archiving, and extracting them is unnecessary overhead.

So the idea is `py_wheel` provides `(prefix, files)` information, which can then be used by consumers. This then allows e.g.

```
py_wheel(name="foo_whl", ...)
py_wheel_as_py_library(
name = "foo_whl_as_pylib",
srcs = [":foo_whl"]
)
py_test(
name="foo",
deps = ["foo_whl_as_pylib"],
)
```

Where `py_wheel_as_py_library` returns PyInfo() et al pointing to what the whl would extract to (i.e. a directory with the contents of the wheel).

Looking at py_wheel, this looks quite doable, since Starlark is already generating most (if not all?) of what goes into the wheel, and the `wheelmaker.py` program is mostly just zip's the files up.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reading the existing py_wheel implementation and wheelmaker.py to understand how wheel contents and their prefix are produced. Define how py_wheel exposes the prefix and files, and how py_wheel_as_py_library uses them to provide PyInfo() without staging or extracting an archive. Done means a build-time generated wheel can be consumed by py_test through the proposed dependency pattern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.