| 231 | |
| 232 | |
| 233 | def create_complete_platform(complete_platform_file: Path, platform: PlatformConfig) -> None: |
| 234 | with pex3_binary(platform=platform) as pex3: |
| 235 | complete_platform = json.loads( |
| 236 | subprocess.run( |
| 237 | args=[pex3, "interpreter", "inspect", "--markers", "--tags"], |
| 238 | stdout=subprocess.PIPE, |
| 239 | check=True, |
| 240 | ).stdout |
| 241 | ) |
| 242 | path = complete_platform.pop("path") |
| 243 | |
| 244 | complete_platform["__meta_data__"] = { |
| 245 | "comment": ( |
| 246 | "DO NOT EDIT - Generated via: `uv run dev-cmd gen-scie-platform -- " |
| 247 | "--pbs-release {pbs_release} --python-version {python_version}`.".format( |
| 248 | pbs_release=platform.pbs_release, |
| 249 | python_version=platform.python_version, |
| 250 | ) |
| 251 | ), |
| 252 | "pbs-release": platform.pbs_release, |
| 253 | "python-version": platform.python_version, |
| 254 | } |
| 255 | |
| 256 | logger.info(f"Generating {complete_platform_file} using Python at:\n{path}") |
| 257 | |
| 258 | complete_platform_file.parent.mkdir(parents=True, exist_ok=True) |
| 259 | with complete_platform_file.open("w") as fp: |
| 260 | json.dump(complete_platform, fp, indent=2, sort_keys=True) |
| 261 | |
| 262 | |
| 263 | def main(out: IO[str]) -> str | int | None: |