bazel-contrib / bazel-contrib/rules_python

Support building from `sdist` in a build action

Offen
#2,410 14 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
help wanted type: feature request type: pip
Vorherrschende Sprache
Starlark
Sterne
688
Forks
721
Ø Merge
15 Std. 7 Min.
Gemergte PRs (30 T.)
76

Beschreibung

Support building from `sdist` as a build action instead of `repository_rule`.

Things needed:
* [ ] A way to use a different `repository` rule that would not do any building with `pip`.
* [ ] Parsing the dependencies from `pyproject.toml` so that the `deps` field is populated at the repository time.
* [ ] A `pip` toolchain or something similar for building packages. Maybe we should have a `toolchain` for each build backend in the https://peps.python.org/pep-0621/
* [ ] A way to specify build dependencies see #1325.
* [ ] How do we build Python extensions?

Initial thoughts:
* It would be good to create an `sdist_archive` rule, which would download a given `sdist` by URL and then would parse `pyproject.toml`. If the `pyproject.toml` is not found or it is dynamic and requires Python to correctly infer the dependencies, we may need to fail at least in the first iteration.
* Using Python in the repository context is OK, but adds a lot of complication in the long run - we should attempt to limit its usage as much as possible.

At the moment I don't have time to work on this myself, but writing it down so that an issue for PEP621 based sdist building exists. Feel free to add thoughts here on possible design.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Überprüfe den bestehenden repository_rule- und build-action-Ablauf und untersuche anschließend, wie Abhängigkeiten in pyproject.toml behandelt werden. Verwende die vorgeschlagene sdist_archive-Regel und PEP 621 als Ausgangspunkte und kläre die Unterstützung für Build-Abhängigkeiten, Build-Backends und Python-Erweiterungen. Die Aufgabe ist erledigt, wenn der unterstützte Entwurf und der Implementierungsumfang vereinbart sind, statt als offene Fragen bestehen zu bleiben.

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
Muss geklärt werden
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

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