-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
53 lines (37 loc) · 1.39 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import dataclasses
import typing as T
# Cannot use `from __future__ import annotations` because validobj does not
# support annotations
@dataclasses.dataclass
class MesonArgs:
"""
Contents of [tool.hatch.build.hooks.meson.args] items
"""
setup: T.List[str] = dataclasses.field(default_factory=list)
"""Additional args to pass to ``meson setup``"""
compile: T.List[str] = dataclasses.field(default_factory=list)
"""Additional args to pass to ninja or ``meson compile``"""
install: T.List[str] = dataclasses.field(default_factory=list)
"""Arguments to ``meson install``"""
# hatch-meson does not use `meson dist`
@dataclasses.dataclass
class HatchMesonConfig:
"""
Contents of [tool.hatch.build.hooks.meson] items
"""
meson: T.Optional[str] = None
"""Meson to use"""
limited_api: bool = False
"""Build extension modules targeting the limited API"""
args: MesonArgs = dataclasses.field(default_factory=lambda: MesonArgs())
@dataclasses.dataclass
class CmdlineConfig:
"""
Contents of config settings passed in through a build tool
"""
build_dir: T.Optional[str] = None
editable_verbose: bool = False
# dist_args: T.Union[None, str, T.List[str]] = None
setup_args: T.Union[None, str, T.List[str]] = None
compile_args: T.Union[None, str, T.List[str]] = None
install_args: T.Union[None, str, T.List[str]] = None