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

Show file and line number in deprecation warnings #4631

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Jan 13, 2025

Make it easier to track down where the deprecation warnings are coming from.

adhami3310
adhami3310 previously approved these changes Jan 13, 2025
frame = inspect.currentframe()
while frame := frame and frame.f_back:
frame_path = Path(inspect.getfile(frame)).resolve()
if frame_path.name == "typing_extensions.py":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there anything special about typing_extensions? can we make that behavior generic over such examples?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest diff uses a more generic and extensible method for excluding packages

Less bespoke method of considering some packages to be part of the framework
and passed over when finding user code.
@masenf masenf merged commit fbf9524 into main Jan 15, 2025
41 checks passed
@masenf masenf deleted the masenf/dedupe-warnings-with-line branch January 15, 2025 22:19
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.

2 participants