Skip to content

Fix DeviceGroup compatibility with click >= 8.2.0#2078

Merged
syssi merged 1 commit into
masterfrom
fix/click-820-positional-args-compat
Jun 27, 2026
Merged

Fix DeviceGroup compatibility with click >= 8.2.0#2078
syssi merged 1 commit into
masterfrom
fix/click-820-positional-args-compat

Conversation

@syssi

@syssi syssi commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • click 8.2.0 inserted a new commands positional parameter into MultiCommand.__init__, shifting all subsequent positional args by one slot
  • This caused chain=False to be passed as subcommand_metavar, making click try to " ".join([..., False, ...])TypeError
  • Fix: pass all arguments as keyword args in DeviceGroup.__init__ — parameter names are unchanged across click versions, so this is fully backwards-compatible

Fixes #2031

Test plan

  • miiocli fan shows help without error with click 8.1.8
  • miiocli fan shows help without error with click 8.2.0+

click 8.2.0 inserted a new 'commands' positional parameter into
MultiCommand.__init__, shifting all subsequent positional args by one.
This caused 'chain' (False) to land as 'subcommand_metavar', resulting
in a TypeError when click tried to join format pieces.

Fix by passing all arguments as keyword args, which is stable across
click versions since the parameter names haven't changed.

Fixes #2031
@syssi syssi force-pushed the fix/click-820-positional-args-compat branch from 82bc1dc to 4ca008f Compare June 27, 2026 15:21
@syssi syssi requested a review from rytilahti June 27, 2026 15:22
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.49%. Comparing base (8d63876) to head (4ca008f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2078      +/-   ##
==========================================
+ Coverage   83.48%   83.49%   +0.01%     
==========================================
  Files         199      199              
  Lines       19519    19519              
  Branches     1058     1058              
==========================================
+ Hits        16295    16297       +2     
+ Misses       3038     3036       -2     
  Partials      186      186              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@syssi syssi merged commit 1374cfd into master Jun 27, 2026
14 checks passed
@syssi syssi deleted the fix/click-820-positional-args-compat branch June 27, 2026 15:25
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.

Breaking change with click dependency >= 8.2.0 / miiocli unusable with latest update

2 participants