Skip to content

Add test for forward refs #20

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

Merged
merged 5 commits into from
Sep 25, 2020
Merged

Add test for forward refs #20

merged 5 commits into from
Sep 25, 2020

Conversation

flying-sheep
Copy link
Collaborator

@flying-sheep flying-sheep commented Sep 24, 2020

Fixes #14 once ready

I still can’t reproduce #14 locally, but I can here! Seems to have to do with dataclasses:

https://github.com/theislab/scanpydoc/runs/1165147987

cc @ded8393

@theislab theislab deleted a comment from codecov bot Sep 25, 2020
@flying-sheep
Copy link
Collaborator Author

flying-sheep commented Sep 25, 2020

OK, progress I think. The generous help from pytest ❤️ tells us that:

  1. The error happens for obj = <function __init__ at 0x7fa87f7db820>, options = {'members': []}

  2. get_type_hints appears to be unable to find the module:

    globalns = localns = {
        'MISSING': <dataclasses._MISSING_TYPE object at 0x7fa880778a00>,
        '_HAS_DEFAULT_FACTORY': <factory>,
        '__builtins__': <module 'builtins' (built-in)>,
    }

I assume this is https://bugs.python.org/issue34776, and probably fixed in python/cpython#9518 which was backported to


Yo, WTF, they’re using ancient python patch versions 🤯:

@codecov
Copy link

codecov bot commented Sep 25, 2020

Codecov Report

Merging #20 into master will decrease coverage by 2.47%.
The diff coverage is 31.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #20      +/-   ##
==========================================
- Coverage   85.67%   83.20%   -2.48%     
==========================================
  Files           9        9              
  Lines         363      381      +18     
==========================================
+ Hits          311      317       +6     
- Misses         52       64      +12     
Impacted Files Coverage Δ
scanpydoc/elegant_typehints/return_tuple.py 76.38% <31.57%> (-14.36%) ⬇️

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 c4aad6e...e68dacb. Read the comment docs.

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.

Elegant typehints cannot resolve forward-references
1 participant