|
21 | 21 | from pathlib import Path |
22 | 22 | import csv |
23 | 23 | import sys |
| 24 | +import re |
24 | 25 | from collections import defaultdict |
25 | 26 |
|
26 | 27 | REPO_ROOT = Path(__file__).resolve().parent.parent.parent.parent |
|
36 | 37 | "tensorrt": "cuda & cutlass & tensorrt", |
37 | 38 | "ethosn": "Ethosn", |
38 | 39 | "hexagon": "Hexagon", |
39 | | - "metal": "metal", |
| 40 | + "metal": "Metal", |
| 41 | + "vulkan": "Vulkan", |
40 | 42 | "cmsis-nn": "CMSIS-NN", |
41 | 43 | "clml": "OpenCL & CLML", |
42 | 44 | "opencl": "OpenCL & CLML", |
| 45 | + "openclml": "OpenCL & CLML", |
43 | 46 | "adreno": "Adreno", |
44 | 47 | "acl": "ArmComputeLibrary", |
45 | 48 | "rocm": "ROCm", |
|
86 | 89 | "bug": "BugFix", |
87 | 90 | "hotfix": "BugFix", |
88 | 91 | "relay": "Relay", |
| 92 | + "qnn": "Relay", |
| 93 | + "quantization": "Relay", |
89 | 94 | "tvmscript": "TVMScript", |
90 | 95 | "tvmscripts": "TVMScript", |
91 | 96 | "tvmc": "TVMC", |
@@ -156,16 +161,39 @@ def categorize_csv_file(csv_path: str): |
156 | 161 | if __name__ == "__main__": |
157 | 162 | help = "List out commits with attached PRs since a certain commit" |
158 | 163 | parser = argparse.ArgumentParser(description=help) |
159 | | - parser.add_argument("--notes-csv", required=True, help="csv file of categorized PRs in order") |
| 164 | + parser.add_argument( |
| 165 | + "--notes", required=True, help="csv or markdown file of categorized PRs in order" |
| 166 | + ) |
160 | 167 | parser.add_argument( |
161 | 168 | "--is-pr-with-link", |
162 | 169 | required=False, |
163 | 170 | help="exported pr number with hyper-link for forum format", |
164 | 171 | ) |
| 172 | + parser.add_argument( |
| 173 | + "--convert-with-link", |
| 174 | + required=False, |
| 175 | + help="make PR number in markdown file owning hyper-link", |
| 176 | + ) |
165 | 177 | args = parser.parse_args() |
166 | 178 | user = "apache" |
167 | 179 | repo = "tvm" |
168 | 180 |
|
| 181 | + if args.convert_with_link: |
| 182 | + with open("release_note_0.13.0.md", "r") as f: |
| 183 | + lines = f.readlines() |
| 184 | + formated = [] |
| 185 | + for line in lines: |
| 186 | + match = re.search(r"#\d+", line) |
| 187 | + if match: |
| 188 | + pr_num_str = match.group() |
| 189 | + pr_num_int = pr_num_str.replace("#", "") |
| 190 | + pr_number_str = f"[#{pr_num_int}](https://github.com/apache/tvm/pull/{pr_num_int})" |
| 191 | + line = line.replace(pr_num_str, pr_number_str) |
| 192 | + formated.append(line) |
| 193 | + result = "".join(formated) |
| 194 | + print(result) |
| 195 | + exit(0) |
| 196 | + |
169 | 197 | # 1. Create PR dict from cache file |
170 | 198 | cache = Path("out.pkl") |
171 | 199 | if not cache.exists(): |
@@ -204,7 +232,6 @@ def pr_title(number, heading): |
204 | 232 | continue |
205 | 233 | value = dict(value) |
206 | 234 | output += f"### {key}\n" |
207 | | - |
208 | 235 | misc = [] |
209 | 236 | misc += value.get("n/a", []) |
210 | 237 | misc += value.get("Misc", []) |
|
0 commit comments