MCPcopy Index your code
hub / github.com/numpy/numpy / write_release

Function write_release

tools/write_release.py:30–58  ·  view source on GitHub ↗

Copy the -notes.rst file to the OUTPUT_DIR and use pandoc to translate it to markdown. That results in both README.rst and README.md files that can be used for on github for the release. Parameters ---------- version: str Release version, e.g., '2.3.2',

(version)

Source from the content-addressed store, hash-verified

28OUTPUT_FILE = "README"
29
30def write_release(version):
31 """
32 Copy the <version>-notes.rst file to the OUTPUT_DIR and use
33 pandoc to translate it to markdown. That results in both
34 README.rst and README.md files that can be used for on
35 github for the release.
36
37 Parameters
38 ----------
39 version: str
40 Release version, e.g., '2.3.2', etc.
41
42 Returns
43 -------
44 None.
45
46 """
47 notes = Path(NOTES_DIR) / f"{version}-notes.rst"
48 outdir = Path(OUTPUT_DIR)
49 outdir.mkdir(exist_ok=True)
50 target_md = outdir / f"{OUTPUT_FILE}.md"
51 target_rst = outdir / f"{OUTPUT_FILE}.rst"
52
53 # translate README.rst to md for posting on GitHub
54 os.system(f"cp {notes} {target_rst}")
55 subprocess.run(
56 ["pandoc", "-s", "-o", str(target_md), str(target_rst), "--wrap=preserve"],
57 check=True,
58 )
59
60
61if __name__ == '__main__':

Callers 1

write_release.pyFile · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…