bazel-contrib / bazel-contrib/rules_python

multi_pip_parse should support platform specific requirement files

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

Beschreibung

# 🚀 feature request

### Relevant Rules

I think we should extend the functionality of `multi_pip_parse` to deal with platform specific requirement files better.

### Description
Currently you can do this to have different lock files on different versions of python
```
multi_pip_parse(
...
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```
but the platform specific attributes take strings (and not dict) so you can only have a single requirements file on a specific platform
```
multi_pip_parse(
...
requirements_linux = "//requirements:requirements_lock_3_12_linux.txt",
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```
The platform specific requirements should also allow you to specify a dict so we can express the proper requirements files on various platforms

### Describe the solution you'd like
Ideally it would just look like this
```
multi_pip_parse(
...
requirements_linux = {
"3.10": "//:requirements_lock_3_10_linux.txt",
"3.12": "//:requirements_lock_3_12_linux.txt",
},
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```

### Describe alternatives you've considered
I'm not really sure there are any good alternative solutions, this feels like it is just missing functionality

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

The entry point is multi_pip_parse; start by tracing how requirements_lock and requirements_linux are declared and selected. Compare the existing Python-version dictionary handling with the platform-specific attributes. Done means platform-specific attributes accept the shown version-to-label mappings while preserving current string behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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