[+] partially update meson_install

1. add parsing of tool section
    from pyproject.toml;
    to add install arguments for meson_install;
This commit is contained in:
Siarhei Siniak 2025-05-12 15:51:42 +03:00
parent 43c85ca162
commit 51f08a0ea6
4 changed files with 20 additions and 5 deletions

@ -5,7 +5,7 @@ project(
).stdout().strip('\n'),
# 'online.fxreader.uv',
# ['c', 'cpp'],
version: '0.1.5.16+27.11',
version: '0.1.5.16+27.12',
# default_options: [
# 'cpp_std=c++23',
# # 'prefer_static=true',

@ -28,15 +28,21 @@ class Project:
dest_dir : pathlib.Path
meson_path: Optional[pathlib.Path] = None
@dataclasses.dataclass
class PyProject:
@dataclasses.dataclass
class Tool:
@dataclasses.dataclass
class Meson:
@dataclasses.dataclass
class Args:
install: list[str]
args: Args
@dataclasses.dataclass
class MesonPython:
@dataclasses.dataclass
class Args:
install: list[str]
@ -349,6 +355,8 @@ class CLI(abc.ABC):
force: Optional[bool] = None,
argv: Optional[list[str]] = None,
) -> None:
from . import cli_bootstrap
project = self.projects[project_name]
if force is None:
@ -365,8 +373,8 @@ class CLI(abc.ABC):
)
pyproject_tool = pydantic.RootModel[
PyProject
].model_validate(pyproject.module)
PyProject.Tool
].model_validate(pyproject.tool).root
if (
pyproject_tool.meson and
@ -379,8 +387,8 @@ class CLI(abc.ABC):
shutil_which('meson', True,),
'install',
'-C',
project.build_dir / 'meson',
'--destdir', project.dest_dir,
str(project.build_dir / 'meson'),
'--destdir', str(project.dest_dir),
*argv,
]

@ -54,6 +54,10 @@ class PyProject:
default_factory=lambda : [],
)
tool: dict[str, Any] = dataclasses.field(
default_factory=dict,
)
def pyproject_load(
d: pathlib.Path,
) -> PyProject:

Binary file not shown.