File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,14 @@ scikit\_build\_core.errors module
4141 :show-inheritance:
4242 :undoc-members:
4343
44+ scikit\_ build\_ core.format module
45+ ---------------------------------
46+
47+ .. automodule :: scikit_build_core.format
48+ :members:
49+ :show-inheritance:
50+ :undoc-members:
51+
4452scikit\_ build\_ core.program\_ search module
4553------------------------------------------
4654
Original file line number Diff line number Diff line change 1+ """Format variables available in the ``pyproject.toml`` evaluation"""
2+
3+ from __future__ import annotations
4+
5+ import dataclasses
6+ from collections .abc import Mapping
7+ from typing import TYPE_CHECKING , Any
8+
9+ if TYPE_CHECKING :
10+ from collections .abc import Iterator
11+
12+ from scikit_build_core .settings .skbuild_model import ScikitBuildSettings
13+
14+ __all__ = [
15+ "Formatter" ,
16+ ]
17+
18+
19+ @dataclasses .dataclass
20+ class Formatter (Mapping [str , Any ]):
21+ """Formatting helper"""
22+
23+ _dict : dict [str , Any ] = dataclasses .field (init = False )
24+ """Dict storage of the acceptable variable keys and their expanded values."""
25+ settings : ScikitBuildSettings
26+ """Parsed settings."""
27+
28+ def __getitem__ (self , key : str ) -> Any :
29+ return self ._dict [key ]
30+
31+ def __len__ (self ) -> int :
32+ return len (self ._dict )
33+
34+ def __iter__ (self ) -> Iterator [Any ]:
35+ return iter (self ._dict )
36+
37+ def __post_init__ (self ) -> None :
38+ # TODO: Initialize the container with all known values
39+ self ._dict = {}
You can’t perform that action at this time.
0 commit comments