diff --git a/packages/tangle-cli/src/tangle_cli/__init__.py b/packages/tangle-cli/src/tangle_cli/__init__.py index 1804ad6..3e558f9 100644 --- a/packages/tangle-cli/src/tangle_cli/__init__.py +++ b/packages/tangle-cli/src/tangle_cli/__init__.py @@ -14,6 +14,6 @@ try: __version__ = metadata_version("tangle-cli") except PackageNotFoundError: - __version__ = "0.1.8" + __version__ = "0.1.9" __all__ = ["TangleDynamicDiscoveryClient", "__version__"] diff --git a/packages/tangle-cli/src/tangle_cli/pipeline_hydrator.py b/packages/tangle-cli/src/tangle_cli/pipeline_hydrator.py index 1a55d63..485aeeb 100644 --- a/packages/tangle-cli/src/tangle_cli/pipeline_hydrator.py +++ b/packages/tangle-cli/src/tangle_cli/pipeline_hydrator.py @@ -1157,6 +1157,7 @@ def _resolve_by_name_with_filters( search_names, verbose=False, published_by=publisher, + include_deprecated=bool(version_constraint), ) if not candidates: self.log.info(f" Resolve: no candidates for name={component_name}") diff --git a/pyproject.toml b/pyproject.toml index 2a64ca0..e0dba17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "tangle-cli" -version = "0.1.8" +version = "0.1.9" description = "CLI for Tangle, the open-source ML pipeline orchestration platform" readme = "README.md" authors = [ diff --git a/tests/test_packaging.py b/tests/test_packaging.py index 59c8b3e..5a9d414 100644 --- a/tests/test_packaging.py +++ b/tests/test_packaging.py @@ -183,7 +183,7 @@ def test_tangle_cli_wheel_supports_expert_no_deps_import_path_without_tangle_api requires_dist = [line for line in metadata.splitlines() if line.startswith("Requires-Dist: ")] assert not any(name.startswith("tangle_api/") for name in names) assert "tangle_cli/openapi/openapi.json" not in names - assert "Version: 0.1.8" in metadata + assert "Version: 0.1.9" in metadata assert "Requires-Dist: tangle-api==0.1.1" in requires_dist assert not any("extra == 'native'" in line for line in requires_dist) assert "Provides-Extra: native" in metadata diff --git a/tests/test_pipelines_cli.py b/tests/test_pipelines_cli.py index d9f001e..7b3378a 100644 --- a/tests/test_pipelines_cli.py +++ b/tests/test_pipelines_cli.py @@ -1410,6 +1410,47 @@ def get_component_spec(self, digest): "components": ["Thing", "[Official] Thing"], "verbose": False, "published_by": "alice@example.com", + "include_deprecated": True, + } + ] + + +def test_pipeline_hydrator_resolve_config_name_without_version_excludes_deprecated( + tmp_path: Path, +): + from tangle_cli.pipeline_hydrator import PipelineHydrator + + calls = [] + + class FakeClient: + def find_existing_components(self, components, **kwargs): + calls.append({"components": components, **kwargs}) + return [SimpleNamespace(digest="sha256:active", version="2.0")] + + def get_component_spec(self, digest): + assert digest == "sha256:active" + return SimpleNamespace( + data={ + "name": "Thing", + "metadata": {"annotations": {"version": "2.0"}}, + "implementation": {"container": {"image": "active"}}, + } + ) + + digest, spec = PipelineHydrator(client=FakeClient())._resolve_from_config( + {"name": "Thing"}, + "Pipeline.task", + tmp_path, + ) + + assert digest == "sha256:active" + assert spec["implementation"]["container"]["image"] == "active" + assert calls == [ + { + "components": ["Thing", "[Official] Thing"], + "verbose": False, + "published_by": None, + "include_deprecated": False, } ] diff --git a/uv.lock b/uv.lock index 2a49bac..bc24095 100644 --- a/uv.lock +++ b/uv.lock @@ -2083,7 +2083,7 @@ requires-dist = [{ name = "pydantic", specifier = ">=2.0" }] [[package]] name = "tangle-cli" -version = "0.1.8" +version = "0.1.9" source = { editable = "." } dependencies = [ { name = "cloud-pipelines" },