diff --git a/.env.test b/.env.test index fee5278..6dc442e 100644 --- a/.env.test +++ b/.env.test @@ -7,5 +7,5 @@ PYTEST_ADMIN_PASSWORD=start123 PYTEST_DEFAULT_MASTER_IMAGE=python/base PYTEST_ASYNC_MAX_RETRIES=5 PYTEST_ASYNC_RETRY_DELAY_MILLIS=500 -PYTEST_HUB_VERSION=0.16.1 +PYTEST_HUB_VERSION=0.18.0 PYTEST_RESPONSE_TIMEOUT=5 diff --git a/flame_hub/_core_client.py b/flame_hub/_core_client.py index 435c189..d30b119 100644 --- a/flame_hub/_core_client.py +++ b/flame_hub/_core_client.py @@ -2,10 +2,11 @@ import typing as t import uuid from datetime import datetime +import warnings import httpx2 as httpx import typing_extensions as te -from pydantic import WrapValidator, Field, BeforeValidator +from pydantic import WrapValidator, Field, BeforeValidator, AliasChoices from flame_hub._auth_client import Realm from flame_hub._base_client import ( @@ -279,7 +280,15 @@ class Analysis(CreateAnalysis): configuration_node_default_valid: bool configuration_nodes_valid: bool build_status: ProcessStatus | None - build_nodes_valid: bool + # TODO: Drop build_nodes_valid in favor of distribution_nodes_valid in the next major version. + distribution_nodes_valid: bool = Field( + validation_alias=AliasChoices( + "distribution_nodes_valid", + "distributionNodesValid", + "build_nodes_valid", + "buildNodesValid", + ) + ) build_progress: int | None build_hash: str | None build_os: str | None @@ -298,6 +307,15 @@ class Analysis(CreateAnalysis): project: t.Annotated[Project | None, IsIncludable] = None master_image: t.Annotated[MasterImage | None, IsIncludable] = None + @property + def build_nodes_valid(self) -> bool: + warnings.warn( + "'build_nodes_valid' is deprecated, use 'distribution_nodes_valid' instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.distribution_nodes_valid + class UpdateAnalysis(CoreBaseModel): description: str | None | UNSET_T = UNSET diff --git a/tests/test_core.py b/tests/test_core.py index 1190841..4df031a 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -175,7 +175,6 @@ def _wait_for_analysis_bucket_file(): yield analysis_bucket_file - core_client.delete_analysis_bucket_file(analysis_bucket_file) storage_client.delete_bucket_file(bucket_file.id) @@ -235,8 +234,8 @@ def _check_analysis_logs_present(): def registry(core_client): new_registry = core_client.create_registry( name=next_random_string(), - host=next_random_string(), - # account_name=next_random_string(), + host=f"{next_random_string()}.com", + account_name=next_random_string(), account_secret=next_random_string(), ) yield new_registry