MCPcopy
hub / github.com/pex-tool/pex / create_complete_platform

Function create_complete_platform

scripts/gen-scie-platform.py:233–260  ·  view source on GitHub ↗
(complete_platform_file: Path, platform: PlatformConfig)

Source from the content-addressed store, hash-verified

231
232
233def 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
263def main(out: IO[str]) -> str | int | None:

Callers 1

mainFunction · 0.85

Calls 6

pex3_binaryFunction · 0.85
infoMethod · 0.80
openMethod · 0.80
runMethod · 0.45
popMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected