Fix CLI flags and scaffold assets from example notebook - #5
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| flags = argument["flags"] | ||
| kwargs = dict(argument["kwargs"]) | ||
| if "dest" in argument and argument["dest"]: | ||
| kwargs["dest"] = argument["dest"] | ||
| subparser.add_argument(*flags, **kwargs) |
There was a problem hiding this comment.
Skip setting dest for positional CLI arguments
The new parser builder now unconditionally injects dest for every registered argument before calling add_argument. Argparse raises ValueError: dest supplied twice for positional argument when dest is provided for positionals, so any subcommand that expects positional parameters (e.g., the many handlers that take an arguments list) will fail while constructing the parser and the pydifft CLI cannot start. Drop the dest override for non-option arguments to allow the parser to build.
Useful? React with 👍 / 👎.
| source_root = example_notebook_root() | ||
| if not source_root.exists(): | ||
| raise RuntimeError("example_notebook directory is missing") |
There was a problem hiding this comment.
Ship example_notebook assets required by qmdinit
qmdinit now hard-requires the example_notebook directory and immediately raises a RuntimeError if it is missing, but the packaging config no longer installs any notebook templates (pyproject.toml lists only pydifftools* packages and no data files), so installed wheels will not contain example_notebook. Running pydifft qmdinit in an installed environment will therefore fail before scaffolding anything. Include the example assets in the package or provide a packaged fallback to keep qmdinit usable.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task