trio icon indicating copy to clipboard operation
trio copied to clipboard

Fixes for 3.13

Open A5rocks opened this issue 1 year ago • 1 comments

Fixes https://github.com/python-trio/trio/issues/3004, also refs https://github.com/python-trio/trio/issues/2885

@njsmith could you check my naive locals() -> sys._getframe().f_locals replacement? Unfortunately 3.13 makes locals() mutations not mutate actual local variables, as part of PEP 667. I'm especially not sure about the replacement in _run.py where locals() used to clear something (not sure what).

A5rocks avatar May 24 '24 15:05 A5rocks

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.63%. Comparing base (3350c11) to head (f62e81e).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #3005    +/-   ##
========================================
  Coverage   99.63%   99.63%            
========================================
  Files         120      120            
  Lines       17783    17963   +180     
  Branches     3197     3243    +46     
========================================
+ Hits        17718    17898   +180     
  Misses         46       46            
  Partials       19       19            
Files with missing lines Coverage Δ
src/trio/_core/_ki.py 100.00% <100.00%> (ø)
src/trio/_core/_run.py 99.38% <100.00%> (+0.04%) :arrow_up:
src/trio/_path.py 100.00% <100.00%> (ø)
src/trio/_tests/test_exports.py 99.61% <100.00%> (+<0.01%) :arrow_up:
src/trio/_tests/test_path.py 100.00% <100.00%> (ø)
src/trio/_tools/gen_exports.py 99.15% <100.00%> (ø)
src/trio/socket.py 100.00% <ø> (ø)

... and 6 files with indirect coverage changes

codecov[bot] avatar May 24 '24 15:05 codecov[bot]

Seems like with these changes CancelScope.__exit__ doesn't need to inline the KI protection decorator anymore, so I pushed a commit on that.

richardsheridan avatar May 27 '24 16:05 richardsheridan

I think this is ready for review/merge. While this applied as a patch doesn't seem to work, I can't seem to reproduce that and I'm sure it's just some other PR that changed things just enough for this subtle locals stuff to work (which can be located probably just using a git bisect?).

A5rocks avatar Jun 10 '24 23:06 A5rocks

I think you can get 3.13 to pass in CI if you explicitly install cffi==1.17.0rc1 as a dependency: https://github.com/python-cffi/cffi/releases/tag/v1.17.0rc1 Since it's a release candidate pip doesn't automatically target it.

I wrote a PR to get trio-websocket to support trio>0.25 https://github.com/python-trio/trio-websocket/pull/188, so once merged that may fully resolve the issues encountered by the distro maintainers.

jakkdl avatar Jun 12 '24 10:06 jakkdl

Alright, this is now running the whole test suite (rather than the part that doesn't require the test requirements).

A5rocks avatar Jun 12 '24 15:06 A5rocks