Skip to content

feat(cli): deprecate version command in favor of --version flag#3206

Open
chrisqiqiu wants to merge 1 commit intoapache:mainfrom
chrisqiqiu:deprecate-version-command
Open

feat(cli): deprecate version command in favor of --version flag#3206
chrisqiqiu wants to merge 1 commit intoapache:mainfrom
chrisqiqiu:deprecate-version-command

Conversation

@chrisqiqiu
Copy link
Copy Markdown

@chrisqiqiu chrisqiqiu commented Mar 29, 2026

Closes #3160

Rationale for this change

The pyiceberg version subcommand is non-standard. Most CLI tools use --version instead.
This PR adds --version via Click's built-in click.version_option() and deprecates the
old version subcommand with a visible warning message, following the project's deprecation
conventions.

Note: I chose removed_in="1.0.0" to match the existing deprecation in the REST catalog
(see pyiceberg/catalog/rest/__init__.py), but happy to adjust if a different version is preferred.

Are these changes tested?

Yes. Added two new tests:

  • test_version_flag — verifies pyiceberg --version works correctly
  • test_version_command_emits_deprecation_warning — verifies the old command still works but emits a DeprecationWarning and prints a visible deprecation notice to stderr

Updated the existing test_version_does_not_load_catalog to account for the deprecation warning.
Screenshot 2026-03-29 at 11 47 37 pm

Screenshot 2026-03-29 at 11 59 54 pm

Are there any user-facing changes?

Yes:

  • pyiceberg --version is now available
  • pyiceberg version still works but prints a deprecation warning
  • Help text updated to reflect the deprecation

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.

deprecate CLI version in favor of --version

1 participant