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

Fix attrs redone #3058

Merged
merged 5 commits into from
Aug 8, 2024
Merged

Fix attrs redone #3058

merged 5 commits into from
Aug 8, 2024

Conversation

A5rocks
Copy link
Contributor

@A5rocks A5rocks commented Aug 5, 2024

#3054 didn't catch everything. However the root cause was that pytest imports trio during plugin phase and doesn't handle deprecation warnings by erroring then.

To fix that, we can just clear the module cache and try importing again. I'm not completely sold on this idea but it's the best one I had and it works.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.63%. Comparing base (223e4f4) to head (72c1c68).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3058   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files         120      121    +1     
  Lines       17832    17839    +7     
  Branches     3204     3206    +2     
=======================================
+ Hits        17767    17774    +7     
  Misses         46       46           
  Partials       19       19           
Files Coverage Δ
src/trio/_tests/test_trio.py 100.00% <100.00%> (ø)
src/trio/_tests/tools/test_mypy_annotate.py 100.00% <100.00%> (ø)
src/trio/_threads.py 100.00% <100.00%> (ø)

@A5rocks A5rocks changed the title Fix attrs redux Fix attrs redone Aug 5, 2024
Copy link
Member

@CoolCat467 CoolCat467 left a comment

Choose a reason for hiding this comment

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

Looks good, but to be honest kind of confused about the reasoning for test_endtoend changes

@A5rocks
Copy link
Contributor Author

A5rocks commented Aug 5, 2024

The mypy annotate tool uses pickle so you don't want to use a cached version of trio otherwise it fails.

(It gets the cached version of trio even though that was deleted from sys.modules because it's cached by the tool)

@CoolCat467
Copy link
Member

Makes sense, thanks for explaining. In that case though, why is there another call to cached main just a few lines down then?

main(["--dumpfile", str(result_file)])

@A5rocks
Copy link
Contributor Author

A5rocks commented Aug 5, 2024

Oh I missed that! I'm surprised that doesn't error.

I assume it's cause it loads the object from pickle which uses the version of trio I just used rather than the one cached in the main. That's just a guess though.

@A5rocks A5rocks requested a review from CoolCat467 August 7, 2024 14:35
@A5rocks A5rocks force-pushed the fix-attrs-redux branch 2 times, most recently from 3e90307 to 72c1c68 Compare August 7, 2024 14:41
@A5rocks
Copy link
Contributor Author

A5rocks commented Aug 7, 2024

Sorry about the review request, I tried something that seemed to work locally but it didn't work in CI (after I requested your review again).

I probably just somehow set things up incorrectly.

@A5rocks A5rocks merged commit 6fe02c0 into python-trio:main Aug 8, 2024
66 checks passed
@A5rocks A5rocks deleted the fix-attrs-redux branch August 8, 2024 00:23
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