From 9a35824ae4aa1eb42ab823a38961a81e2ce6acb5 Mon Sep 17 00:00:00 2001 From: robcohen Date: Sat, 7 Feb 2026 12:50:31 -0600 Subject: [PATCH 1/2] fix: address issues #68, #69, #70 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - #68: Document wasmtime requirement for deb/rpm users in README - #69: Add fallback version for --version in PyInstaller builds - #70: Allow WASI access to entire filesystem for include paths with ".." Closes #69 Closes #70 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- README.md | 5 +++++ src/rustfava/cli.py | 12 +++++++++++- src/rustfava/rustledger/engine.py | 8 ++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e88047553..6720f4356 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,11 @@ Download the latest release for your platform from the [Releases page](https://g | **Windows** | `.exe` installer or `.msi` | | **Linux** | `.AppImage`, `.deb`, `.rpm`, or `.tar.gz` | +> **Note for Linux deb/rpm users**: The server component requires [wasmtime](https://wasmtime.dev/). Install it with: +> ```bash +> curl https://wasmtime.dev/install.sh -sSf | bash +> ``` + ### Other Installation Methods | Method | Command | diff --git a/src/rustfava/cli.py b/src/rustfava/cli.py index b632718c4..6b3ac0fac 100644 --- a/src/rustfava/cli.py +++ b/src/rustfava/cli.py @@ -8,6 +8,16 @@ import click +# Version for PyInstaller builds where importlib.metadata is unavailable +__version__ = "0.1.8" + +try: + from importlib.metadata import version as get_version + + __version__ = get_version("rustfava") +except Exception: + pass + class AddressInUse(click.ClickException): # noqa: D101 def __init__(self, port: int) -> None: # pragma: no cover @@ -93,7 +103,7 @@ def _add_env_filenames(filenames: tuple[str, ...]) -> tuple[str, ...]: @click.option( "--poll-watcher", is_flag=True, help="Use old polling-based watcher." ) -@click.version_option(package_name="rustfava") +@click.version_option(version=__version__) def main( # noqa: PLR0913 *, filenames: tuple[str, ...] = (), diff --git a/src/rustfava/rustledger/engine.py b/src/rustfava/rustledger/engine.py index 348cfbf38..934439049 100644 --- a/src/rustfava/rustledger/engine.py +++ b/src/rustfava/rustledger/engine.py @@ -263,7 +263,9 @@ def is_encrypted(self, filepath: str) -> bool: """ # Resolve to absolute path for WASM file access file_path = Path(filepath).resolve() - allow_dir = str(file_path.parent) + # Use root "/" to allow include paths with ".." (parent directory references) + # This matches native beancount behavior where includes can reference any path + allow_dir = "/" result_json = self._run( ["is-encrypted", str(file_path)], allow_dir=allow_dir, @@ -438,7 +440,9 @@ def load_full( - loaded_files: List of all resolved include files """ file_path = Path(filepath).resolve() - allow_dir = str(file_path.parent) + # Use root "/" to allow include paths with ".." (parent directory references) + # This matches native beancount behavior where includes can reference any path + allow_dir = "/" # Build command args args = ["load-full", str(file_path)] From 270c27e9f21cc3221a8b184334585ebf620c226f Mon Sep 17 00:00:00 2001 From: robcohen Date: Sat, 7 Feb 2026 13:01:32 -0600 Subject: [PATCH 2/2] fix: add pragma no cover for PyInstaller fallback --- src/rustfava/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rustfava/cli.py b/src/rustfava/cli.py index 6b3ac0fac..d577ff7d7 100644 --- a/src/rustfava/cli.py +++ b/src/rustfava/cli.py @@ -15,7 +15,7 @@ from importlib.metadata import version as get_version __version__ = get_version("rustfava") -except Exception: +except Exception: # pragma: no cover pass