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

Resolve ForwardRefs on return annotations #73

Merged

Conversation

tlambert03
Copy link
Member

This PR also resolves ForwardRefs on return type annotations (#66 only handled ForwardRefs on parameter annotations).

I also changed it so that register_type immediately resolves any ForwardRefs. It's unlikely that someone would be passing a forwardref there, but it will also work now.

@codecov
Copy link

codecov bot commented Dec 29, 2020

Codecov Report

Merging #73 (09ea592) into master (da0383e) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
+ Coverage   87.37%   87.48%   +0.11%     
==========================================
  Files          15       15              
  Lines        1592     1606      +14     
==========================================
+ Hits         1391     1405      +14     
  Misses        201      201              
Impacted Files Coverage Δ
magicgui/function_gui.py 91.66% <100.00%> (-0.07%) ⬇️
magicgui/type_map.py 94.92% <100.00%> (+0.19%) ⬆️
magicgui/widgets/_bases.py 89.60% <100.00%> (+0.22%) ⬆️

Continue to review full report at Codecov.

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

Copy link
Contributor

@sofroniewn sofroniewn left a comment

Choose a reason for hiding this comment

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

Just confirmed this now works as expected and fixes napari/napari#2028 (comment). Thanks!!

@tlambert03 tlambert03 changed the title Resolve ForwardRefs on return annotations too Resolve ForwardRefs on return annotations Dec 29, 2020
@tlambert03 tlambert03 merged commit 98bfb8a into pyapp-kit:master Dec 29, 2020
@tlambert03 tlambert03 deleted the fix-return-annotation-forward-ref branch December 29, 2020 20:26
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.

None yet

2 participants