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

Use correct type for add_view #3633

Merged
merged 2 commits into from
Jul 5, 2019
Merged

Use correct type for add_view #3633

merged 2 commits into from
Jul 5, 2019

Conversation

kornicameister
Copy link
Contributor

@kornicameister kornicameister commented Mar 3, 2019

What do these changes do?

They are changing the type declaration for add_view in router. Previously it said that it was to be AbstractView but that required an instance of the AbstractView subclass. The documentation stands for it to be the class, hence changing the typing to Type[AbstractView].

Are there changes in behavior for the user?

No more mypy errors when using add_view method/function.

Related issue number

Fixes #3653

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@kornicameister
Copy link
Contributor Author

@asvetlov tests and mypy went fine for me locally. However I noticed that isort started to complain on master state (today). I didn't pushed those changes though. If you want to me to create an issue so there's a track, let me know.

@codecov-io
Copy link

codecov-io commented Mar 3, 2019

Codecov Report

Merging #3633 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3633      +/-   ##
==========================================
- Coverage    97.9%   97.84%   -0.06%     
==========================================
  Files          43       43              
  Lines        8556     8649      +93     
  Branches     1376     1381       +5     
==========================================
+ Hits         8377     8463      +86     
- Misses         74       81       +7     
  Partials      105      105
Impacted Files Coverage Δ
aiohttp/web_routedef.py 100% <100%> (ø) ⬆️
aiohttp/web_urldispatcher.py 99.25% <100%> (ø) ⬆️
aiohttp/frozenlist.py 97.87% <0%> (-2.13%) ⬇️
aiohttp/connector.py 96.36% <0%> (-1.32%) ⬇️
aiohttp/payload.py 98.13% <0%> (-0.47%) ⬇️
aiohttp/web_request.py 96.99% <0%> (-0.45%) ⬇️
aiohttp/client_reqrep.py 97.02% <0%> (-0.32%) ⬇️
aiohttp/web_runner.py 97.64% <0%> (-0.29%) ⬇️
aiohttp/streams.py 98.44% <0%> (-0.27%) ⬇️
aiohttp/http_websocket.py 98.62% <0%> (-0.03%) ⬇️
... and 16 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 398b5ba...86faab1. Read the comment docs.

@Hanaasagi
Copy link
Member

It will resolve: #123

@kornicameister
Copy link
Contributor Author

kornicameister commented Apr 19, 2019

@asvetlov will it be possible to give it a look?
@webknjaz sorry to bother you too, but maybe if @asvetlov is busy, you might give it a shot?

@kornicameister
Copy link
Contributor Author

Hmm..I have tried to sign the CLA, but for some reason there are requests in https://cla-assistant.io/aio-libs/aiohttp?pullRequest=3633 that fail with 401. Not sure why though.

@asvetlov
Copy link
Member

Sorry, @kornicameister
I've added CLA checker, but it had problems.
Later I've removed the app but github still has CLA in the checklist for existing PRs.
Just ignore it.
I'm slowly iterating over aiohttp PRs waiting for review, please keep calm.
The review process is not fast because I've committed to finish some work for asyncio on upcoming Python 3.8. The feature freeze is in less than 2 weeks.
After that date I can dedicate much more time to work on aiohttp

@kornicameister
Copy link
Contributor Author

Ah, ok...I though that maybe the PR is not being checked because of missing CLA :/. I shall be calm :)

GL with Python 3.8.

@asvetlov asvetlov merged commit 5ea9169 into aio-libs:master Jul 5, 2019
@asvetlov
Copy link
Member

asvetlov commented Jul 5, 2019

Thanks!

asvetlov pushed a commit that referenced this pull request Jul 5, 2019
(cherry picked from commit 5ea9169)

Co-authored-by: Tomasz Trębski <kornicameister@gmail.com>
asvetlov added a commit that referenced this pull request Jul 5, 2019
(cherry picked from commit 5ea9169)

Co-authored-by: Tomasz Trębski <kornicameister@gmail.com>
@kornicameister kornicameister deleted the type_add_view branch July 5, 2019 11:54
@kornicameister
Copy link
Contributor Author

@asvetlov Cheers 👍

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.

web.view should accept Type[AbstractView] as handler instead of AbstractView
4 participants