Ensure extract_rt_targets is run only once per build
This commit is contained in:
parent
77fbdfbb53
commit
9e9aa52553
@ -20,7 +20,7 @@ def find_page_title(text: str) -> str:
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
def main() -> Dict[str, str]:
|
def main() -> Dict[str, Dict[str, str]]:
|
||||||
refs = {}
|
refs = {}
|
||||||
docs = {}
|
docs = {}
|
||||||
base = os.path.dirname(os.path.abspath(__file__))
|
base = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|||||||
11
setup.py
11
setup.py
@ -21,7 +21,7 @@ from functools import lru_cache, partial
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import (
|
from typing import (
|
||||||
Callable, Dict, FrozenSet, Iterable, List, Optional, Sequence, Set, Tuple,
|
Callable, Dict, FrozenSet, Iterable, List, Optional, Sequence, Set, Tuple,
|
||||||
Union
|
Union, cast
|
||||||
)
|
)
|
||||||
|
|
||||||
from glfw import glfw
|
from glfw import glfw
|
||||||
@ -840,9 +840,14 @@ def init_env_from_args(args: Options, native_optimizations: bool = False) -> Non
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def build_ref_map() -> str:
|
@lru_cache
|
||||||
|
def extract_rst_targets() -> Dict[str, Dict[str, str]]:
|
||||||
m = runpy.run_path('docs/extract-rst-targets.py')
|
m = runpy.run_path('docs/extract-rst-targets.py')
|
||||||
d = m['main']()
|
return cast(Dict[str, Dict[str, str]], m['main']())
|
||||||
|
|
||||||
|
|
||||||
|
def build_ref_map() -> str:
|
||||||
|
d = extract_rst_targets()
|
||||||
h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
|
h = 'static const char docs_ref_map[] = {\n' + textwrap.fill(', '.join(map(str, bytearray(json.dumps(d).encode('utf-8'))))) + '\n};\n'
|
||||||
dest = 'kitty/docs_ref_map_generated.h'
|
dest = 'kitty/docs_ref_map_generated.h'
|
||||||
q = ''
|
q = ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user