383383
384384KIND_PURLS_FILENAME = "purls.yml"
385385KIND_VULNERABILITIES_FILENAME = "vulnerabilities.yml"
386+ KIND_API_PACKAGE_METADATA_FILENAME = "api_package_metadata.yml"
386387
387388
388389def 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+
402410def get_package_base_dir (purl : Union [PackageURL , str ]):
403411 """
404412 Return the base path to a Package directory (ignoring version) for a purl
@@ -586,7 +594,7 @@ def from_yaml_config(
586594
587595 if data ["name" ] != name :
588596 raise TypeError (
589- f"Inconsistent federation name { name !r} with YAML config text: { text !r} "
597+ f"Inconsistent federation name { name !r} " f" with YAML config text: { text !r} "
590598 )
591599
592600 lrd = local_root_dir and Path (local_root_dir ) or None
@@ -930,7 +938,7 @@ def __post_init__(self):
930938 )
931939
932940 if not is_valid_power_of_two (self .number_of_dirs ):
933- raise TypeError (f"number_of_dirs must be a power of 2, not { self .number_of_dirs !r} " )
941+ raise TypeError (f"number_of_dirs must be a power of 2, " f" not { self .number_of_dirs !r} " )
934942
935943 if not self .number_of_repos or self .number_of_repos > self .number_of_dirs :
936944 raise TypeError (
@@ -939,7 +947,9 @@ def __post_init__(self):
939947 )
940948
941949 if not is_valid_power_of_two (self .number_of_repos ):
942- raise TypeError (f"number_of_repos must be a power of 2, not { self .number_of_repos !r} " )
950+ raise TypeError (
951+ f"number_of_repos must be a power of 2, " f"not { self .number_of_repos !r} "
952+ )
943953
944954 @property
945955 def numbers_of_dirs_per_repo (self ) -> int :
0 commit comments