|
| 1 | +# Plan: Fix uvx fallback for tenzir-node |
| 2 | + |
| 3 | +## Problem |
| 4 | + |
| 5 | +The current uvx fallback for `tenzir-node` runs `uvx tenzir-node`, but `tenzir-node` is not a standalone package—it's a script within the `tenzir` package. The correct command is: |
| 6 | + |
| 7 | +```bash |
| 8 | +uvx --from tenzir tenzir-node |
| 9 | +``` |
| 10 | + |
| 11 | +## Solution |
| 12 | + |
| 13 | +Modify `_resolve_binary()` in `src/tenzir_test/config.py` to use `--from tenzir` syntax for `tenzir-node`: |
| 14 | + |
| 15 | +**Current code (line 51-52):** |
| 16 | + |
| 17 | +```python |
| 18 | +if shutil.which("uvx"): |
| 19 | + return ("uvx", binary_name) |
| 20 | +``` |
| 21 | + |
| 22 | +**Updated code:** |
| 23 | + |
| 24 | +```python |
| 25 | +if shutil.which("uvx"): |
| 26 | + if binary_name == "tenzir-node": |
| 27 | + return ("uvx", "--from", "tenzir", "tenzir-node") |
| 28 | + return ("uvx", binary_name) |
| 29 | +``` |
| 30 | + |
| 31 | +## Files to Modify |
| 32 | + |
| 33 | +1. **`src/tenzir_test/config.py`** (line 51-52) |
| 34 | + - Update `_resolve_binary()` to use `--from tenzir` for `tenzir-node` |
| 35 | + |
| 36 | +2. **`tests/test_config.py`** (line 64) |
| 37 | + - Change expected value from `("uvx", "tenzir-node")` to `("uvx", "--from", "tenzir", "tenzir-node")` |
| 38 | + |
| 39 | +3. **`.docs/src/content/docs/reference/test-framework/index.mdx`** (line 568) |
| 40 | + - Change `uvx tenzir-node` to `uvx --from tenzir tenzir-node` |
| 41 | + |
| 42 | +4. **`.docs/src/content/docs/guides/testing/write-tests.mdx`** (line 18) |
| 43 | + - Change `uvx tenzir-node` to `uvx --from tenzir tenzir-node` |
| 44 | + |
| 45 | +## Verification |
| 46 | + |
| 47 | +1. Run unit tests: `uv run pytest tests/test_config.py -v` |
| 48 | +2. Test manually with uvx available but no tenzir-node in PATH |
| 49 | + |
| 50 | +## Commit & Push |
| 51 | + |
| 52 | +After verification, commit and push changes in both repositories: |
| 53 | + |
| 54 | +1. **Main repo** (`$PWD`): Commit code and test changes |
| 55 | +2. **Docs repo** (`$PWD/.docs`): Commit documentation changes |
0 commit comments