[Python APIView] Support @overloads and fix issue with parameterized decorators#3044
[Python APIView] Support @overloads and fix issue with parameterized decorators#3044tjprescott merged 9 commits intomainfrom
Conversation
packages/python-packages/api-stub-generator/apistub/nodes/_function_node.py
Show resolved
Hide resolved
bd9ec81 to
9f547e3
Compare
9f547e3 to
c2ce569
Compare
|
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: |
packages/python-packages/api-stub-generator/apistub/nodes/_class_node.py
Show resolved
Hide resolved
packages/python-packages/api-stub-generator/apistub/nodes/_class_node.py
Show resolved
Hide resolved
packages/python-packages/apistubgentest/apistubgentest/models/_models.py
Show resolved
Hide resolved
db2ac51 to
62ea247
Compare
mikeharder
left a comment
There was a problem hiding this comment.
Is this PR supposed to targeting branch main or feature/api-stub-generator_v0.2.11?
|
@mikeharder it's supposed to be targeting a feature branch until @praveenkuttappan tells me it's safe to target main. |
|
@tjprescott: It looks like this PR includes unrelated changes from main, in addition to your code changes. If we want to update the feature branch with the latest changes in main, I would do that in a separate commit (or PR) to the feature branch, so that this PR only contains your code changes. |
|
@mikeharder I've retargeted it to main. |
mikeharder
left a comment
There was a problem hiding this comment.
Thanks for targeting main, I can recuse myself from this PR now.
No longer targeting feature branch.
62ea247 to
f8e67a3
Compare
fd42b5e to
edc7788
Compare
Fixes Azure/azure-sdk-for-python#3028. This was a pretty simple bug in the logic to parse decorators.
Closes Azure/azure-sdk-for-python#3012, Azure/azure-sdk-for-python#3011, Azure/azure-sdk-for-python#3010. This was a much more involved fix because inspect cannot see overloads. Instead, I have to parse the source of the enclosing class and parse the decorators from the AST nodes, which is messy (and unfortunate!).
Here's the APIVIew for this. See "SomethingWithDecorators" and "SomethingWithOverloads":
https://apiviewstaging.azurewebsites.net/Assemblies/Review/b821d6b6f4c94d6a907be8773e8767ab
Note that the diagnostics will go away once Azure/azure-sdk-for-python#2933 is merged.
Test to verify this addresses recently reported issues: