Skip to content

fix(tinytorch): tito package nbdev --test/--clean/--build-docs crash, wrong command names - #1975

Open
Shashank-Tripathi-07 wants to merge 1 commit into
harvard-edge:devfrom
Shashank-Tripathi-07:fix/tinytorch-nbdev-command-names
Open

fix(tinytorch): tito package nbdev --test/--clean/--build-docs crash, wrong command names#1975
Shashank-Tripathi-07 wants to merge 1 commit into
harvard-edge:devfrom
Shashank-Tripathi-07:fix/tinytorch-nbdev-command-names

Conversation

@Shashank-Tripathi-07

Copy link
Copy Markdown
Contributor

Bug

`tito package nbdev --clean` (and `--test`, `--build-docs`) crash outright:

```
FileNotFoundError: [WinError 2] The system cannot find the file specified
❌ Unexpected error: [WinError 2] The system cannot find the file specified
```

Root cause

All three call `subprocess.run(["nbdev_docs"])` / `["nbdev_test"]` / `["nbdev_clean"]` (underscores). nbdev 3.x actually registers these console scripts with hyphens -- confirmed by listing what's really installed in a venv's `Scripts/` directory: `nbdev-docs.exe`, `nbdev-test.exe`, `nbdev-clean.exe`, not the underscore forms. The underscore names have never existed, so these three code paths always crash.

Fix

  • Renamed to the correct hyphenated commands.
  • Consolidated the three near-identical subprocess-run-and-report blocks into one `_run_nbdev_tool()` helper.
  • Added a `try/except FileNotFoundError` with a clear message (same pattern as the sibling dev/clean and dev/build fixes), so a genuinely missing nbdev install fails with an explanation rather than a raw traceback.
  • Applied the `encoding="utf-8", errors="replace"` fix from the subprocess-encoding PR here too, so this stays correct regardless of merge order between the two.

Testing

`tito package nbdev --clean` now runs successfully instead of crashing. Found while running every `tito` command group end to end looking for exactly this class of bug.

… wrong command names

All three call subprocess.run(["nbdev_docs"]) / ["nbdev_test"] /
["nbdev_clean"] (underscores). nbdev 3.x registers these console
scripts with hyphens instead (nbdev-docs, nbdev-test, nbdev-clean --
confirmed against what's actually installed in a venv's Scripts/bin
directory); the underscore names have never existed, so every one of
these crashed with an unhandled FileNotFoundError and a raw traceback.

Renamed to the correct hyphenated commands and consolidated the three
near-identical subprocess.run/result-handling blocks into one
_run_nbdev_tool() helper, which also now catches FileNotFoundError
with a message pointing at what's actually missing (matching the same
pattern already used for the other subprocess calls fixed this
session), and applies the encoding="utf-8", errors="replace" fix from
the sibling subprocess-encoding PR so this doesn't regress if that
merges in a different order.

Verified: `tito package nbdev --clean` now runs successfully instead
of crashing.
@github-actions github-actions Bot added area: tinytorch TinyTorch framework core type: bug bug in rendering labels Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tinytorch TinyTorch framework core type: bug bug in rendering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant