diff --git a/tests/scripts/release/README.md b/tests/scripts/release/README.md index 5d068c65f9ea..ad823c70b34d 100644 --- a/tests/scripts/release/README.md +++ b/tests/scripts/release/README.md @@ -30,9 +30,16 @@ Once done, you can download the csv file assuming with name `out_pr_gathered_cor ```bash # example: use a csv of tags-corrected PRs to create a markdown file -# If you want to export monthly report on forum, you need append arg -# `--is-pr-with-link true`. -python make_notes.py --notes-csv out_pr_gathered_corrected.csv > out.md + +# Export monthly report on forum: +python make_notes.py --notes out_pr_gathered_corrected.csv --is-pr-with-link true > monthly_report.md + +# Export release report on Github: +python make_notes.py --notes out_pr_gathered_corrected.csv --is-pr-with-link true > release_report.md + +# If release report exported but forget set `--is-pr-with-link true`, +# you can append arg `--convert-with-link true`. +python3 make_notes.py --notes ./release_report.md --convert-with-link true ``` You can also create a list of RFCs diff --git a/tests/scripts/release/make_notes.py b/tests/scripts/release/make_notes.py index aa034b1d113c..2aa96d6555c1 100644 --- a/tests/scripts/release/make_notes.py +++ b/tests/scripts/release/make_notes.py @@ -21,6 +21,7 @@ from pathlib import Path import csv import sys +import re from collections import defaultdict REPO_ROOT = Path(__file__).resolve().parent.parent.parent.parent @@ -36,10 +37,12 @@ "tensorrt": "cuda & cutlass & tensorrt", "ethosn": "Ethosn", "hexagon": "Hexagon", - "metal": "metal", + "metal": "Metal", + "vulkan": "Vulkan", "cmsis-nn": "CMSIS-NN", "clml": "OpenCL & CLML", "opencl": "OpenCL & CLML", + "openclml": "OpenCL & CLML", "adreno": "Adreno", "acl": "ArmComputeLibrary", "rocm": "ROCm", @@ -86,6 +89,8 @@ "bug": "BugFix", "hotfix": "BugFix", "relay": "Relay", + "qnn": "Relay", + "quantization": "Relay", "tvmscript": "TVMScript", "tvmscripts": "TVMScript", "tvmc": "TVMC", @@ -156,16 +161,39 @@ def categorize_csv_file(csv_path: str): if __name__ == "__main__": help = "List out commits with attached PRs since a certain commit" parser = argparse.ArgumentParser(description=help) - parser.add_argument("--notes-csv", required=True, help="csv file of categorized PRs in order") + parser.add_argument( + "--notes", required=True, help="csv or markdown file of categorized PRs in order" + ) parser.add_argument( "--is-pr-with-link", required=False, help="exported pr number with hyper-link for forum format", ) + parser.add_argument( + "--convert-with-link", + required=False, + help="make PR number in markdown file owning hyper-link", + ) args = parser.parse_args() user = "apache" repo = "tvm" + if args.convert_with_link: + with open("release_note_0.13.0.md", "r") as f: + lines = f.readlines() + formated = [] + for line in lines: + match = re.search(r"#\d+", line) + if match: + pr_num_str = match.group() + pr_num_int = pr_num_str.replace("#", "") + pr_number_str = f"[#{pr_num_int}](https://github.com/apache/tvm/pull/{pr_num_int})" + line = line.replace(pr_num_str, pr_number_str) + formated.append(line) + result = "".join(formated) + print(result) + exit(0) + # 1. Create PR dict from cache file cache = Path("out.pkl") if not cache.exists(): @@ -204,7 +232,6 @@ def pr_title(number, heading): continue value = dict(value) output += f"### {key}\n" - misc = [] misc += value.get("n/a", []) misc += value.get("Misc", [])