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

change format_args to prefer annotations from typing.get_type_hints #5280

Merged
merged 2 commits into from Aug 13, 2018

Conversation

terencehonles
Copy link
Contributor

Subject: change format_args to prefer annotations from typing.get_type_hints

Feature or Bugfix

  • Bugfix

Purpose

The current code looks for the pattern:

class Node:
    def parent(self) -> 'Node': pass

This change allows more complex forward references:

class Node:
    def children(self) -> Set['Node']: pass

@codecov
Copy link

codecov bot commented Aug 9, 2018

Codecov Report

Merging #5280 into master will decrease coverage by 0.8%.
The diff coverage is 11.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5280      +/-   ##
==========================================
- Coverage   82.24%   81.44%   -0.81%     
==========================================
  Files         302      292      -10     
  Lines       39585    38865     -720     
  Branches     6094     5794     -300     
==========================================
- Hits        32557    31653     -904     
- Misses       5691     5843     +152     
- Partials     1337     1369      +32
Impacted Files Coverage Δ
tests/test_util_inspect.py 59.51% <0%> (-31.1%) ⬇️
sphinx/util/inspect.py 48.97% <16.66%> (-24.42%) ⬇️
sphinx/util/pycompat.py 47.14% <0%> (-42.86%) ⬇️
sphinx/pycode/__init__.py 78.66% <0%> (-9.34%) ⬇️
tests/test_pycode_parser.py 91.73% <0%> (-8.27%) ⬇️
tests/conftest.py 84.61% <0%> (-7.7%) ⬇️
tests/test_smartquotes.py 92.5% <0%> (-7.5%) ⬇️
tests/test_pycode.py 92.59% <0%> (-7.41%) ⬇️
... and 42 more

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 c48a612...da45604. Read the comment docs.

@terencehonles terencehonles force-pushed the prefer-typing.get_type_hints branch 3 times, most recently from 6091950 to 8470cf9 Compare August 9, 2018 22:45
Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

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

LGTM.
I'd like to merge this into 1.7 branch. Could you rebase this please?

terencehonles and others added 2 commits August 10, 2018 11:58
The current code looks for the pattern::

    class Node:
        def parent(self) -> 'Node': pass

This change allows more complex forward references::

    class Node:
        def children(self) -> Set['Node']: pass
@terencehonles terencehonles changed the base branch from master to 1.7 August 10, 2018 18:58
@terencehonles
Copy link
Contributor Author

@tk0miya done!

@tk0miya
Copy link
Member

tk0miya commented Aug 13, 2018

Thank you for quick work!

@tk0miya tk0miya merged commit 3e82d09 into sphinx-doc:1.7 Aug 13, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this pull request Aug 13, 2018
@terencehonles terencehonles deleted the prefer-typing.get_type_hints branch August 13, 2018 20:38
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants