mesonbuild / mesonbuild/meson-python

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

Open
#402 11 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Python
Stars
180
Forks
93
Avg merge
2d 7h
Merged PRs (30d)
18

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the documentation for Python installation paths, get_install_dir, and configure_file's install_dir option. Document that meson-python requires the subdirectory to be passed through get_install_dir(subdir: ...) rather than appended to its result, and include the shown example and wheel-mapping error behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.