Skip to content

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jun 9, 2025

What do these changes do?

Only enable line tracing when building with Cython tracing

This PR modifies the build backend to dynamically enable Cython line tracing only when explicitly requested via the with-cython-tracing=true config setting. Previously, having linetrace = "True" in pyproject.toml was causing build issues for users (aio-libs/frozenlist#658) and makes our production wheels almost half as fast.

Now, line tracing is opt-in:

  • Regular builds: pip install . (no line tracing)
  • Tracing builds: pip install . --config-setting=with-cython-tracing=true (enables line tracing)

When tracing is requested, the build backend automatically adds the linetrace=True and profile=True Cython directives and sets the appropriate C compiler flags.

Are there changes in behavior for the user?

  • Regular users will no longer encounter build issues related to line tracing being enabled by default
  • Developers who need line tracing must now explicitly enable it using --config-setting=with-cython-tracing=true
  • The YARL_CYTHON_TRACING environment variable can also be used as an alternative to the config setting

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

Only turn it on when we build with line tracing
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jun 9, 2025
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <webknjaz@redhat.com>
@bdraco bdraco marked this pull request as ready for review June 9, 2025 20:33
Copy link

codspeed-hq bot commented Jun 9, 2025

CodSpeed Performance Report

Merging #1521 will not alter performance

Comparing linetrace (39152ec) with master (d1286db)

Summary

✅ 101 untouched benchmarks

Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.62%. Comparing base (d1286db) to head (39152ec).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1521      +/-   ##
==========================================
+ Coverage   99.37%   99.62%   +0.24%     
==========================================
  Files          30       29       -1     
  Lines        6068     5798     -270     
  Branches      265      265              
==========================================
- Hits         6030     5776     -254     
+ Misses         35       19      -16     
  Partials        3        3              
Flag Coverage Δ
CI-GHA 99.62% <100.00%> (+0.24%) ⬆️
MyPy 98.06% <100.00%> (+<0.01%) ⬆️
OS-Linux 99.80% <ø> (+0.35%) ⬆️
OS-Windows 99.48% <ø> (ø)
OS-macOS 99.68% <ø> (+0.34%) ⬆️
Py-3.10.11 99.45% <ø> (+0.33%) ⬆️
Py-3.10.17 99.70% <ø> (+0.34%) ⬆️
Py-3.11.12 99.70% <ø> (+0.34%) ⬆️
Py-3.11.9 99.45% <ø> (+0.33%) ⬆️
Py-3.12.10 99.70% <ø> (+0.34%) ⬆️
Py-3.13.3 99.70% <ø> (+0.34%) ⬆️
Py-3.13.4t 99.75% <ø> (ø)
Py-3.9.13 99.41% <ø> (+0.33%) ⬆️
Py-3.9.22 99.65% <ø> (+0.34%) ⬆️
Py-pypy7.3.16 99.33% <ø> (ø)
Py-pypy7.3.19 99.36% <ø> (ø)
VM-macos-latest 99.68% <ø> (+0.34%) ⬆️
VM-ubuntu-latest 99.80% <ø> (+0.35%) ⬆️
VM-windows-latest 99.48% <ø> (ø)
pytest 99.80% <ø> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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

@bdraco bdraco enabled auto-merge (squash) June 9, 2025 20:56
@bdraco bdraco mentioned this pull request Jun 9, 2025
3 tasks
@bdraco bdraco merged commit 63c4461 into master Jun 9, 2025
52 of 54 checks passed
@bdraco bdraco deleted the linetrace branch June 9, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants