Skip to content

Conversation

@Erotemic
Copy link
Member

@Erotemic Erotemic commented May 23, 2025

Report with co-qualname as discussed in #337 (comment)

I'm simply using a check for AttributeError to try to see if qualname is available, and fallback to name otherwise. I could check for the exact python version, but this seems fine. A few tests had to change to account for both name and qualname behaviors happening.

@codecov
Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.96%. Comparing base (c25ff35) to head (a2e46f9).
Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #345      +/-   ##
==========================================
+ Coverage   64.84%   64.96%   +0.12%     
==========================================
  Files          13       13              
  Lines        1041     1056      +15     
  Branches      228      233       +5     
==========================================
+ Hits          675      686      +11     
- Misses        306      309       +3     
- Partials       60       61       +1     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad949aa...a2e46f9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Erotemic Erotemic requested a review from TTsangSC May 23, 2025 15:30
Copy link
Collaborator

@TTsangSC TTsangSC left a comment

Choose a reason for hiding this comment

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

Hi, thanks for having me over for the review.

As previously discussed this is highly useful for end-users, and honestly I'm surprised how little of the test suite we broke (we have a ton of assert 'Function: <something>' in raw_output), but apparently none of that has to do with methods in classes so we're in the clear. I'd expect breakages in downstream tools to be similarly contained, manageable, and worth the change.

Maybe we can tweak the docstring for line_profiler._line_profiler.label() a bit (your call), but otherwise we've good to go methinks.

@Erotemic
Copy link
Member Author

The breakage is because the output is now - Object.foo instead of - foo. I actually have a commit fixing the docstring label but I forgot to push it! Hence why having the extra eyes for a review, even on a simple PR like this, is nice. Appreciated.

NOP_BYTES: bytes = NOP_VALUE.to_bytes(2, byteorder=byteorder)

# This should be true for Python >=3.11a1
HAS_CO_QUALNAME: bool = hasattr(types.CodeType, 'co_qualname'))
Copy link
Collaborator

Choose a reason for hiding this comment

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

))

Oops

@TTsangSC
Copy link
Collaborator

Nice, should be good to go once the CHANGELOG is fixed

@Erotemic Erotemic merged commit d62c880 into pyutils:main May 23, 2025
36 checks passed
TTsangSC added a commit to TTsangSC/line_profiler that referenced this pull request May 23, 2025
TTsangSC added a commit to TTsangSC/line_profiler that referenced this pull request May 24, 2025
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