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 ForwardRef on widget.annotation #66

Merged
merged 2 commits into from
Dec 27, 2020

Conversation

tlambert03
Copy link
Member

closes #65
I think this is probably the right thing to do... We will have already tried to resolve any forward ref annotations when creating widgets, so it should already be in sys.modules and we might as well store the resolved type on widget.annotation for the convenience of others.

@codecov
Copy link

codecov bot commented Dec 27, 2020

Codecov Report

Merging #66 (4732ec3) into master (510d5ef) will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
+ Coverage   77.28%   77.39%   +0.10%     
==========================================
  Files          16       16              
  Lines        1955     1964       +9     
==========================================
+ Hits         1511     1520       +9     
  Misses        444      444              
Impacted Files Coverage Δ
magicgui/widgets/_bases.py 76.87% <100.00%> (+0.45%) ⬆️

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 510d5ef...4732ec3. 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 verified this works as expected for my napari usecases in napari/napari#1856

@tlambert03 tlambert03 merged commit c441861 into pyapp-kit:master Dec 27, 2020
@tlambert03 tlambert03 deleted the resolve-refs-on-widget branch December 27, 2020 11:58
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.

Should we permanently resolve ForwardRef type annotations?
2 participants