Add Podman support, venv fallback backend, and fix local target crash#41
Conversation
…#40) When target is "local" and Docker is unavailable, `prism run` crashed because `build_definitions()` unconditionally attempted `docker build`. Even with `--no-build`, the local fallback failed because recipe dependencies weren't installed. This fixes the crash by detecting the available container runtime (Docker or Podman) before attempting builds, and adds a venv-based fallback that installs requirements.txt dependencies into the project's existing .venv when no container runtime is available. Changes: - Add `detect_container_runtime()` to probe for Docker/Podman on PATH - Parameterize container operations with `runtime` to support Podman - Add `_run_venv()` backend using the project .venv from `prism init` - Hash-based dependency marker (.venv/.deps-hash) skips redundant installs - Container failure now falls back to venv (not bare local) with deps - `prism init` shows container runtime guidance when none is detected - `prism build` accepts `--runtime podman` and auto-detects runtime - Extract shared helpers: `_substitute_python()`, `hash_file_contents()` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@claude please review this pr |
|
Claude finished @EiffL's task in 2m 25s —— View job PR Review: Add Podman support, venv fallback backend, and fix local target crashTasks:
Overall Assessment: This is a solid, well-structured PR that addresses a real user pain point. The architecture is clean — detect → fallback → run — and the hash-based dep marker is a nice touch. A few bugs and rough edges are worth addressing before merge. Issues Found🐛 Bug: Failed pip installs are silently swallowed and marker is still written
for req_file in req_files:
install_result = subprocess.run(...)
if install_result.returncode != 0:
logger.warning(...) # warns but continues
marker.write_text(current_hash + "\n") # written regardless of failures
self._venv_deps_checked = TrueIf 🐛 Regression: Container fallback now errors when
|
|
@claude can you address the review posted above? |
|
Claude finished @EiffL's task in 4m 12s —— View job Addressed PR Review IssuesTasks:
All issues from the review have been addressed in commit
|
…atting - runner.py: Only write .deps-hash marker when all pip installs succeed, preventing a failed install from being silently skipped on the next run - runner.py: When .venv is absent in the docker backend fallback path, fall back to _run_local instead of returning a confusing error, restoring pre-PR behaviour for projects that predate prism init - runner.py: Add comment clarifying local vs venv backend asymmetry in execute() - cli.py: Fix missing newline after Podman URL in prism init guidance message - test_runner_venv.py: Replace six/chardet with pip/setuptools (always in venv) - test_runner_venv.py: Add tests for docker backend with no .venv present Co-authored-by: Francois Lanusse <EiffL@users.noreply.github.com>
|
@claude review this PR |
|
Claude finished @EiffL's task in 1m 31s —— View job PR Review: Add Podman support, venv fallback backend, and fix local target crashTasks:
Overall Assessment: This is a well-executed PR that addresses a real user pain point. All three bugs from the previous review have been correctly fixed. The code is clean and the test coverage is solid. A few very minor nits remain, none blocking. All Previous Issues Addressed ✅Bug: pip failure marker written regardless of success → Fixed correctly. Regression: container fallback crashes when Formatting bug in Test packages Remaining Minor ItemsNit:
|
Summary
Fixes #40 —
prism runwithtarget: localcrashes when Docker is unavailable.build_definitions()no longer unconditionally callsdocker build— it detects the available container runtime first and skips building when none is foundruntimeparameter, supporting both Docker and Podman as drop-in alternatives for local execution.venv/(created byprism init) with dependencies auto-installed fromrequirements*.txtusing a hash-based marker to skip redundant installs_run_venv()(with deps installed) instead of bare_run_local()(without deps)prism initdetects and displays the container runtime, or shows installation guidance for Docker/Podmanprism build --runtime podman: Added podman as a runtime choice and auto-detection when no runtime is specifiedTest plan
ruff checkclean on changed filesmypy— no new errors (pre-existing only)prism runwith Docker available — unchanged behaviorprism runwith only Podman — builds and runs with Podmanprism runwith neither — installs deps into .venv and runs thereprism initwithout container runtime shows guidance message🤖 Generated with Claude Code