mesonbuild / mesonbuild/meson-python

Document meson-pythons requirements for the "install_dir" option of e.g. configure_file

Offen
#402 11 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
documentation
Vorherrschende Sprache
Python
Sterne
180
Forks
93
Ø Merge
2 T. 7 Std.
Gemergte PRs (30 T.)
18

Beschreibung

This issue is somewhat similar to https://github.com/mesonbuild/meson-python/issues/233, but different.

I had the following problem: I tried to configure an `__init__.py` file and install it into a subdirectory of the python install_dir using the pymod.get_install_dir function:

```
pymod = import('python').find_installation(pure: false)
configure_file(input : '__init__.py',
output : '__init__.py',
configuration : conf_data,
install_dir : pymod.get_install_dir() + 'some_subdirectory/',
)
```

This works with meson, but from meson-python I get an error: "Could not map installation path to an equivalent wheel directory: ...". The problem seems to be the "+ 'some_subdirectory/'" because the solution is to put the subdirectory name INTO the get_install_dir command using the subdir keyword_argument:

```
pymod = import('python').find_installation(pure: false)
configure_file(input : '__init__.py',
output : '__init__.py',
configuration : conf_data,
install_dir : pymod.get_install_dir(subdir: 'some_subdirectory'),
)
```

I think this behavior should be documented.
If you tell me where to add this, I can create a pull request.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, die Dokumentation zu Python-Installationspfaden, get_install_dir und der install_dir-Option von configure_file zu finden. Dokumentiere, dass meson-python verlangt, dass das Unterverzeichnis über get_install_dir(subdir: ...) übergeben wird, statt an dessen Ergebnis angehängt zu werden, und nimm das gezeigte Beispiel sowie das Fehlerverhalten beim Wheel-Mapping auf.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

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