2424import argparse
2525import modal
2626from packaging .version import InvalidVersion , Version
27+ from typing import TypedDict
2728
2829POLICYENGINE_VERSION_DICT_NAME = "simulation-api-policyengine-versions"
2930US_VERSION_DICT_NAME = "simulation-api-us-versions"
3031UK_VERSION_DICT_NAME = "simulation-api-uk-versions"
3132APP_RELEASE_BUNDLES_DICT_NAME = "simulation-api-app-release-bundles"
3233
3334
35+ class CountryBundleMetadata (TypedDict ):
36+ country : str
37+ model_package_name : str
38+ model_version : str
39+ data_package_name : str
40+ data_version : str
41+ default_dataset : str
42+ default_dataset_uri : str
43+ dataset_uris : dict [str , str ]
44+ dataset_aliases : dict [str , str ]
45+
46+
47+ class AppReleaseBundleMetadata (TypedDict ):
48+ app_name : str
49+ policyengine_version : str
50+ us : CountryBundleMetadata
51+ uk : CountryBundleMetadata
52+
53+
3454def _is_newer_version (candidate : str , current : str | None ) -> bool :
3555 """Return True when ``candidate`` should replace ``current`` as 'latest'.
3656
@@ -116,7 +136,7 @@ def update_version_dict(
116136 )
117137
118138
119- def _country_bundle_metadata (country : str ) -> dict :
139+ def _country_bundle_metadata (country : str ) -> CountryBundleMetadata :
120140 from policyengine_api_simulation .release_bundle import (
121141 DATASET_ALIASES ,
122142 get_country_release_bundle ,
@@ -140,7 +160,7 @@ def build_app_release_bundle_metadata(
140160 * ,
141161 app_name : str ,
142162 policyengine_version : str ,
143- ) -> dict :
163+ ) -> AppReleaseBundleMetadata :
144164 return {
145165 "app_name" : app_name ,
146166 "policyengine_version" : policyengine_version ,
0 commit comments