Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "vibeshed"
version = "0.2.0"
version = "0.2.1"
description = "Vibe Coding Framework for Personal Automations — agent-agnostic CLI for vibe-coded jobs with passthrough params, exit-code results, and enforced timeouts."
readme = "README.md"
license = { file = "LICENSE" }
Expand Down
2 changes: 1 addition & 1 deletion src/vibeshed/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.0"
__version__ = "0.2.1"
6 changes: 6 additions & 0 deletions src/vibeshed/templates_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ def _resolve(rel_path: str) -> Any:
return node


_IGNORED_DIRS = frozenset({"__pycache__"})
_IGNORED_SUFFIXES = (".pyc", ".pyo")


def _walk_files(node: Any, prefix: str) -> Iterator[Tuple[str, str]]:
for child in sorted(node.iterdir(), key=lambda c: c.name):
if child.name in _IGNORED_DIRS or child.name.endswith(_IGNORED_SUFFIXES):
continue
rel = f"{prefix}{child.name}"
if child.is_file():
yield rel, child.read_text(encoding="utf-8")
Expand Down
15 changes: 15 additions & 0 deletions tests/test_new_and_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ def test_run_unknown_slug(initialized_project: Path, runner: CliRunner) -> None:
assert "not registered" in result.output.lower()


def test_template_walker_skips_pycache(tmp_path: Path) -> None:
from vibeshed.templates_loader import _walk_files

(tmp_path / "main.py").write_text("print('hi')\n", encoding="utf-8")
pycache = tmp_path / "__pycache__"
pycache.mkdir()
# Realistic .pyc header is binary and would crash a UTF-8 read.
(pycache / "main.cpython-312.pyc").write_bytes(b"\xcb\x0d\x0d\x0a\x00\x00")
(tmp_path / "stale.pyc").write_bytes(b"\xcb\x0d\x0d\x0a")
(tmp_path / "stale.pyo").write_bytes(b"\xcb\x0d\x0d\x0a")

rels = [rel for rel, _ in _walk_files(tmp_path, prefix="")]
assert rels == ["main.py"]


def test_run_forwards_passthrough_args(
initialized_project: Path, runner: CliRunner
) -> None:
Expand Down
Loading