-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
Expand file tree
/
Copy pathbuild_details.py
More file actions
37 lines (31 loc) · 837 Bytes
/
build_details.py
File metadata and controls
37 lines (31 loc) · 837 Bytes
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
"""
Generate the PEP 739 'build-details.json' document.
"""
import sys
from pathlib import Path
PEP739_SCHEMA_VERSION = '1.0'
ROOT_DIR = Path(
__file__, # PC/layout/support/build_details.py
'..', # PC/layout/support
'..', # PC/layout
'..', # PC
'..', # <src/install dir>
).resolve()
TOOLS_BUILD_DIR = ROOT_DIR / 'Tools' / 'build'
sys_path = sys.path[:]
try:
sys.path.insert(0, str(TOOLS_BUILD_DIR))
import generate_build_details
except ImportError:
generate_build_details = None
finally:
sys.path = sys_path
del sys_path
def write_relative_build_details(out_path, base_path):
if generate_build_details is None:
return
generate_build_details.write_build_details(
schema_version=PEP739_SCHEMA_VERSION,
base_path=base_path,
location=out_path,
)