Skip to content

Commit 9668c27

Browse files
Use schema namespaces instead of messy lists of imported classes
1 parent 75e61d4 commit 9668c27

35 files changed

Lines changed: 606 additions & 629 deletions

src/usethis/_integrations/backend/uv/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from usethis._integrations.backend.uv.call import call_uv_subprocess
44
from usethis._integrations.backend.uv.errors import UVSubprocessFailedError
55

6-
FALLBACK_UV_VERSION = "0.9.20"
6+
FALLBACK_UV_VERSION = "0.9.21"
77

88

99
def get_uv_version() -> str:

src/usethis/_integrations/ci/bitbucket/cache.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING
4-
53
from usethis._console import tick_print
4+
from usethis._integrations.ci.bitbucket import schema
65
from usethis._integrations.ci.bitbucket.init import (
76
ensure_bitbucket_pipelines_config_exists,
87
)
9-
from usethis._integrations.ci.bitbucket.schema import Definitions
108
from 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

4035
def _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

Comments
 (0)