Skip to content

fix: Click 8.4+ compatibility for ParameterSource detection - #1

Merged
tahouse merged 1 commit into
mainfrom
fix/click-8.4-parametersource-compat
Jun 26, 2026
Merged

fix: Click 8.4+ compatibility for ParameterSource detection#1
tahouse merged 1 commit into
mainfrom
fix/click-8.4-parametersource-compat

Conversation

@tahouse

@tahouse tahouse commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Click 8.4.0 changed ParameterSource from a string-valued enum to an integer-valued enum. str(ParameterSource.COMMANDLINE) now returns "2" instead of "ParameterSource.COMMANDLINE", causing wry's source detection to silently fail — all CLI-provided values were treated as DEFAULT.
  • Fix: use .name attribute instead of str() for reliable enum member name comparison across all Click 8.x versions.
  • Loosen test assertions for Click's changed error message format ('--opt' vs : --opt).

Test plan

  • All 538 tests pass with Click 8.2.1
  • All 538 tests pass with Click 8.4.1
  • Pre-commit hooks pass (ruff, mypy, pytest)

Click 8.4.0 changed ParameterSource from a string-valued enum to an
integer-valued enum. str(ParameterSource.COMMANDLINE) now returns "2"
instead of "ParameterSource.COMMANDLINE", causing source detection to
silently fail — all CLI values were treated as DEFAULT.

Use .name attribute instead of str() for reliable enum member name
comparison across all Click 8.x versions. Also loosen test assertions
for Click's changed error message format.
@tahouse
tahouse merged commit 7964e67 into main Jun 26, 2026
8 of 14 checks passed
@tahouse
tahouse deleted the fix/click-8.4-parametersource-compat branch June 26, 2026 23:50
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