From f8d342254bd3f461694c8d8e453dd8bc91691744 Mon Sep 17 00:00:00 2001 From: woutdenolf Date: Sat, 10 Oct 2026 12:41:49 +0200 Subject: [PATCH 1/2] Set a PIXI_CACHE_DIR fallback for the pixi manager Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 5 +++++ src/ewoks/_requirements/pixi.py | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d77d1..95c7d6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `ewoks convert`: add `--package-manager-name` and `--package-manager-command` arguments. - Add `ewoks lint` CLI command to check if a workflow is conform to the Ewoks specification. +### Fixed + +- `ewoks install` with the `pixi` package manager: no longer fails when the + default cache directory cannot be determined. + ### Removed - `ewoks install`: remove `-p/--python` argument. diff --git a/src/ewoks/_requirements/pixi.py b/src/ewoks/_requirements/pixi.py index bca62fe..c0e0e84 100644 --- a/src/ewoks/_requirements/pixi.py +++ b/src/ewoks/_requirements/pixi.py @@ -4,12 +4,14 @@ import platform import re import sys +import tempfile from pathlib import Path from typing import Dict from typing import Literal from typing import Mapping from typing import Optional from typing import Sequence +from typing import Union from pydantic import Field @@ -68,6 +70,20 @@ def __init__(self, *command: str) -> None: command = ("pixi",) super().__init__(*command) + def _check_output( + self, + *args: Union[str, Path], + extra_env: Optional[Mapping[str, Optional[str]]] = None, + ) -> str: + return super()._check_output(*args, extra_env=_with_cache_dir(extra_env)) + + def _check_call( + self, + *args: Union[str, Path], + extra_env: Optional[Mapping[str, Optional[str]]] = None, + ) -> None: + super()._check_call(*args, extra_env=_with_cache_dir(extra_env)) + def version(self) -> Optional[str]: """Returns None when this manager is not available.""" try: @@ -172,3 +188,14 @@ def _is_workspace_environment(prefix: Path) -> bool: """Environment is managed by a pixi workspace.""" parts = prefix.parts return len(parts) > 2 and parts[-3] == ".pixi" and parts[-2] == "envs" + + +def _with_cache_dir( + extra_env: Optional[Mapping[str, Optional[str]]], +) -> Dict[str, Optional[str]]: + env = dict(extra_env) if extra_env else dict() + if not os.environ.get("PIXI_CACHE_DIR") and not os.environ.get("RATTLER_CACHE_DIR"): + env.setdefault( + "PIXI_CACHE_DIR", str(Path(tempfile.gettempdir()) / "pixi-cache") + ) + return env From f4700abf4fcd2341625a31c865607c527e1c4530 Mon Sep 17 00:00:00 2001 From: woutdenolf Date: Sat, 10 Oct 2026 12:41:49 +0200 Subject: [PATCH 2/2] Match notebook output across all stream chunks, not just one Co-Authored-By: Claude Sonnet 5 --- src/ewoks/tests/test_notebooks.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ewoks/tests/test_notebooks.py b/src/ewoks/tests/test_notebooks.py index a6b0972..fdbe71d 100644 --- a/src/ewoks/tests/test_notebooks.py +++ b/src/ewoks/tests/test_notebooks.py @@ -26,11 +26,9 @@ def verify_notebook(tb: TestbookNotebookClient) -> None: tb.execute() nonlocal output_found - for output in _iter_cell_outputs(tb): - print(output) - if expected_output in output: - output_found = True - break + all_output = "".join(_iter_cell_outputs(tb)) + print(all_output) + output_found = expected_output in all_output decorator(verify_notebook)()