Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing functools.wraps() for @command decorated methods #1478

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

rytilahti
Copy link
Owner

@rytilahti rytilahti commented Jul 27, 2022

This makes defined methods show a proper function signature instead
of the repr of the wrapper.

Example:

<function miio.click_common.DeviceGroup.Command.__call__.<locals>._autodetect_model_if_needed.<locals>._wrap(self, *args, **kwargs)>

becomes

<function miio.integrations.vacuum.roborock.vacuum.RoborockVacuum.status(self) -> miio.integrations.vacuum.roborock.vacuumcontainers.VacuumStatus>

This makes defined methods show a proper function signature instead
of the repr of the wrapper.

Example:

<function miio.click_common.DeviceGroup.Command.__call__.<locals>._autodetect_model_if_needed.<locals>._wrap(self, *args, **kwargs)>

becomes

<function miio.integrations.vacuum.roborock.vacuum.RoborockVacuum.status(self) -> miio.integrations.vacuum.roborock.vacuumcontainers.VacuumStatus>
@rytilahti rytilahti added the bug label Jul 27, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #1478 (4c77754) into master (e955ac4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1478   +/-   ##
=======================================
  Coverage   82.50%   82.50%           
=======================================
  Files         140      140           
  Lines       13907    13908    +1     
  Branches     3304     3305    +1     
=======================================
+ Hits        11474    11475    +1     
  Misses       2214     2214           
  Partials      219      219           
Impacted Files Coverage Δ
miio/click_common.py 52.21% <100.00%> (+0.23%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@rytilahti rytilahti merged commit a5565ce into master Jul 27, 2022
@rytilahti rytilahti deleted the fix/wrap_model_autodetection branch July 27, 2022 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants