Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tests/scripts/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 30 additions & 3 deletions tests/scripts/release/make_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -86,6 +89,8 @@
"bug": "BugFix",
"hotfix": "BugFix",
"relay": "Relay",
"qnn": "Relay",
"quantization": "Relay",
"tvmscript": "TVMScript",
"tvmscripts": "TVMScript",
"tvmc": "TVMC",
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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", [])
Expand Down