11from __future__ import annotations
22
3- from typing import TYPE_CHECKING
4-
53from usethis ._console import tick_print
4+ from usethis ._integrations .ci .bitbucket import schema
65from usethis ._integrations .ci .bitbucket .init import (
76 ensure_bitbucket_pipelines_config_exists ,
87)
9- from usethis ._integrations .ci .bitbucket .schema import Definitions
108from usethis ._integrations .ci .bitbucket .yaml import BitbucketPipelinesYAMLManager
119
12- if TYPE_CHECKING :
13- from usethis ._integrations .ci .bitbucket .schema import Cache , PipelinesConfiguration
14-
1510
16- def get_cache_by_name () -> dict [str , Cache ]:
11+ def get_cache_by_name () -> dict [str , schema . Cache ]:
1712 mgr = BitbucketPipelinesYAMLManager ()
1813 config = mgr .model_validate ()
1914
@@ -28,7 +23,7 @@ def get_cache_by_name() -> dict[str, Cache]:
2823 return cache_by_name
2924
3025
31- def add_caches (cache_by_name : dict [str , Cache ]) -> None :
26+ def add_caches (cache_by_name : dict [str , schema . Cache ]) -> None :
3227 ensure_bitbucket_pipelines_config_exists ()
3328
3429 mgr = BitbucketPipelinesYAMLManager ()
@@ -38,10 +33,10 @@ def add_caches(cache_by_name: dict[str, Cache]) -> None:
3833
3934
4035def _add_caches_via_model (
41- cache_by_name : dict [str , Cache ], * , model : PipelinesConfiguration
36+ cache_by_name : dict [str , schema . Cache ], * , model : schema . PipelinesConfiguration
4237) -> None :
4338 if model .definitions is None :
44- model .definitions = Definitions ()
39+ model .definitions = schema . Definitions ()
4540 if model .definitions .caches is None :
4641 model .definitions .caches = {}
4742
@@ -73,7 +68,7 @@ def remove_cache(cache: str) -> None:
7368 mgr .commit_model (model )
7469
7570
76- def _cache_exists (name : str , * , model : PipelinesConfiguration ) -> bool :
71+ def _cache_exists (name : str , * , model : schema . PipelinesConfiguration ) -> bool :
7772 if model .definitions is None or model .definitions .caches is None :
7873 return False
7974
0 commit comments