(path: str)
| 56 | |
| 57 | |
| 58 | def get_project_info(path: str): |
| 59 | path_project = re.sub(rf"^{os.getcwd()}\/?", "", path) |
| 60 | name = "unknown-package" |
| 61 | version = "0.1.0" |
| 62 | if not path_project: |
| 63 | name = "tensorrt-llm" |
| 64 | import importlib.util |
| 65 | |
| 66 | # get trtllm version from tensorrt_llm/version.py |
| 67 | module_path = os.path.join("tensorrt_llm", "version.py") |
| 68 | spec = importlib.util.spec_from_file_location("trtllm_version", |
| 69 | module_path) |
| 70 | if spec and spec.loader: |
| 71 | version_module = importlib.util.module_from_spec(spec) |
| 72 | spec.loader.exec_module(version_module) |
| 73 | version = version_module.__version__ |
| 74 | else: |
| 75 | matches = re.match(r"^(?:([\w\-]+)?\/)?([\w\-]+)$", path_project) |
| 76 | if matches: |
| 77 | if matches.group(1): |
| 78 | name = f"{matches.group(2)}-{matches.group(1)}" |
| 79 | else: |
| 80 | name = matches.group(2) |
| 81 | return {"name": name, "version": version} |
| 82 | |
| 83 | |
| 84 | def generate_metadata_json(): |
no test coverage detected