Skip to content

feat: Add --version option to CLI#63

Merged
nomenarkt merged 2 commits into
mainfrom
feat/add-version-flag-12731568175865499366
Jan 1, 2026
Merged

feat: Add --version option to CLI#63
nomenarkt merged 2 commits into
mainfrom
feat/add-version-flag-12731568175865499366

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

This change enhances the web2pdfbook command-line tool by adding a --version flag. This allows users to easily check the application's version. The implementation dynamically fetches the version from the package metadata and includes a corresponding unit test to ensure correctness.


PR created automatically by Jules for task 12731568175865499366 started by @nomenarkt

This commit introduces a `--version` option to the command-line interface, allowing users to quickly check the installed version of the application.

- The version is dynamically retrieved from the package metadata using `importlib.metadata.version`.
- The `prog` attribute of the `ArgumentParser` is set to ensure the correct program name is displayed.
- A new test case is added to verify the functionality of the `--version` option.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

This commit addresses the CI failures caused by `PackageNotFoundError` and improves the handling of the `--version` option.

- The CI workflow in `.github/workflows/python-ci.yml` is updated to install the `web2pdfbook` package in editable mode (`pip install -e .`) and to include the `coverage-badge` dependency. This ensures that the package metadata is available during testing and that all required dependencies are installed.
- The `web2pdfbook/cli.py` file is updated to set the `prog` attribute of the `ArgumentParser`, ensuring the correct program name is displayed.
- The `tests/test_cli.py` file is updated to dynamically get the package version, making the test more robust.
@nomenarkt nomenarkt marked this pull request as ready for review January 1, 2026 06:31
@nomenarkt nomenarkt merged commit c87d9e1 into main Jan 1, 2026
2 checks passed
@nomenarkt nomenarkt deleted the feat/add-version-flag-12731568175865499366 branch January 1, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant