Skip to content

fix(adds-on): pass through version flags to real uv binary#31

Merged
benbenbang merged 1 commit into
mainfrom
fix/version_flag
Jun 3, 2026
Merged

fix(adds-on): pass through version flags to real uv binary#31
benbenbang merged 1 commit into
mainfrom
fix/version_flag

Conversation

@benbenbang

Copy link
Copy Markdown
Owner

This pull request fixes the wrapper's handling of version flags to ensure compatibility with tools that parse uv's version output. The main changes prevent the wrapper from intercepting --version and -V flags.

Version flag handling fix:

  • Changed the wrapper to only intercept --wrapper-version for displaying the wrapper's own version, while --version and -V now pass through directly to the real uv binary
  • Updated help text in main.rs to reflect the new --wrapper-version flag and clarify that --version/-V pass through to real uv
  • Added detailed comment explaining why interception breaks tools like pipx and uv's bootstrap that parse version output expecting exact semver format

Test coverage improvements:

  • Renamed version_long_flag() test to wrapper_version_flag() to test the new --wrapper-version flag
  • Added version_long_flag_passes_through() test to verify --version output contains no wrapper banner and has valid semver format
  • Added version_short_flag_passes_through() test to verify -V output contains no wrapper banner
  • Updated test assertions to validate that version flags produce expected output format for external tooling compatibility

This pull request fixes the wrapper's handling of version flags to ensure compatibility with tools that parse uv's version output. The main changes prevent the wrapper from intercepting `--version` and `-V` flags.

**Version flag handling fix:**
* Changed the wrapper to only intercept `--wrapper-version` for displaying the wrapper's own version, while `--version` and `-V` now pass through directly to the real uv binary
* Updated help text in `main.rs` to reflect the new `--wrapper-version` flag and clarify that `--version`/`-V` pass through to real uv
* Added detailed comment explaining why interception breaks tools like pipx and uv's bootstrap that parse version output expecting exact semver format

**Test coverage improvements:**
* Renamed `version_long_flag()` test to `wrapper_version_flag()` to test the new `--wrapper-version` flag
* Added `version_long_flag_passes_through()` test to verify `--version` output contains no wrapper banner and has valid semver format
* Added `version_short_flag_passes_through()` test to verify `-V` output contains no wrapper banner
* Updated test assertions to validate that version flags produce expected output format for external tooling compatibility
@benbenbang
benbenbang enabled auto-merge (squash) June 3, 2026 18:46
@github-actions github-actions Bot added enhancement New feature or request triage labels Jun 3, 2026
@benbenbang
benbenbang merged commit ff2896b into main Jun 3, 2026
2 checks passed
@benbenbang
benbenbang deleted the fix/version_flag branch June 3, 2026 18:46
@ptah-technical-app

Copy link
Copy Markdown

🎉 This PR is included in version 2.6.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant