MCPcopy Index your code
hub / github.com/astral-sh/python-build-standalone / write_cpython_version

Function write_cpython_version

pythonbuild/utils.py:232–240  ·  view source on GitHub ↗

Write a CPython version in a directory.

(dest_path: pathlib.Path, version: str)

Source from the content-addressed store, hash-verified

230
231
232def write_cpython_version(dest_path: pathlib.Path, version: str):
233 """Write a CPython version in a directory."""
234 dest_path.mkdir(parents=True, exist_ok=True)
235
236 major_minor = ".".join(version.split(".")[:2])
237 k = "cpython-%s" % major_minor
238 p = dest_path / ("VERSION.%s" % k)
239 content = "%s_VERSION := %s\n" % (k.upper().replace("-", "_"), version)
240 write_if_different(p, content.encode("ascii"))
241
242
243def write_target_settings(targets, dest_path: pathlib.Path):

Callers 1

mainFunction · 0.90

Calls 1

write_if_differentFunction · 0.85

Tested by

no test coverage detected