Use stacklevel=2 for warnings to report on callsites#1219
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1219 +/- ##
=======================================
Coverage 92.48% 92.48%
=======================================
Files 99 99
Lines 6535 6535
Branches 700 700
=======================================
Hits 6044 6044
Misses 374 374
Partials 117 117 ☔ View full report in Codecov by Sentry. |
Collaborator
|
This makes sense when the warning is coming from |
Member
Author
|
I think it makes sense there, too: vs. and vs. |
sdb9696
approved these changes
Oct 31, 2024
Collaborator
sdb9696
left a comment
There was a problem hiding this comment.
Ok cool, let's merge. N.B. Once all the ANN changes are in we might want to consider putting all the deprecated __getattr__ behind if not TYPE_CHECKING:
Merged
sdb9696
added a commit
that referenced
this pull request
Nov 4, 2024
## [0.7.7](https://github.com/python-kasa/python-kasa/tree/0.7.7) (2024-11-04) [Full Changelog](0.7.6...0.7.7) **Release summary:** - Bugfix for child device device creation error with credentials_hash - PIR support for iot dimmers and wall switches. - Various small enhancements and project improvements. **Implemented enhancements:** - Add PIR&LAS for wall switches mentioning PIR support [\#1227](#1227) (@rytilahti) - Expose ambient light setting for iot dimmers [\#1210](#1210) (@rytilahti) - Expose PIR enabled setting for iot dimmers [\#1174](#1174) (@rytilahti) - Add childprotection module [\#1141](#1141) (@rytilahti) - Initial trigger logs implementation [\#900](#900) (@rytilahti) **Fixed bugs:** - Fix AES child device creation error [\#1220](#1220) (@sdb9696) **Project maintenance:** - Update TC65 fixture [\#1225](#1225) (@rytilahti) - Update smartcamera fixtures from latest dump\_devinfo [\#1224](#1224) (@sdb9696) - Add component queries to smartcamera devices [\#1223](#1223) (@sdb9696) - Update try\_connect\_all to be more efficient and report attempts [\#1222](#1222) (@sdb9696) - Use stacklevel=2 for warnings to report on callsites [\#1219](#1219) (@rytilahti) - parse\_pcap\_klap: various code cleanups [\#1138](#1138) (@rytilahti)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use stacklevel=2 for warnings, as this will correctly show the callsite instead of the line where the warning is reported.
Thanks to https://www.youtube.com/watch?v=Ljfn4x8t3Ow by @asottile
Currently:
After:
Currently:
After: