Skip to content

Commit e989523

Browse files
committed
Add functions to get api package metadata path
Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 0e7adc6 commit e989523

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

aboutcode/federated/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@
383383

384384
KIND_PURLS_FILENAME = "purls.yml"
385385
KIND_VULNERABILITIES_FILENAME = "vulnerabilities.yml"
386+
KIND_API_PACKAGE_METADATA_FILENAME = "api_package_metadata.yml"
386387

387388

388389
def get_package_purls_yml_file_path(purl: Union[PackageURL, str]):
@@ -399,6 +400,13 @@ def get_package_vulnerabilities_yml_file_path(purl: Union[PackageURL, str]):
399400
return get_package_base_dir(purl) / KIND_VULNERABILITIES_FILENAME
400401

401402

403+
def get_api_package_metadata_file_path(purl: Union[PackageURL, str]):
404+
"""
405+
Return the path to a Package api_package_metadata.yml YAML for a purl.
406+
"""
407+
return get_package_base_dir(purl) / KIND_API_PACKAGE_METADATA_FILENAME
408+
409+
402410
def get_package_base_dir(purl: Union[PackageURL, str]):
403411
"""
404412
Return the base path to a Package directory (ignoring version) for a purl

0 commit comments

Comments
 (0)