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

Support addition of routes when handler is wrapped by functools.partial() #4302

Merged
merged 17 commits into from
Oct 29, 2019
Merged

Conversation

yuvalof
Copy link
Contributor

@yuvalof yuvalof commented Oct 29, 2019

What do these changes do?

In aiohttp v4 a new check was added to make sure that route handlers are coroutines.
Python < v3.8 will return False for asyncio.iscoroutine(functools.partial(async_function)).
The change will iterate the wrapped function to make sure its async

Are there changes in behavior for the user?

No

Related issue number

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."

@yuvalof yuvalof requested a review from asvetlov as a code owner October 29, 2019 11:59
@yuvalof yuvalof requested a review from webknjaz as a code owner October 29, 2019 12:00
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 29, 2019
@codecov-io
Copy link

codecov-io commented Oct 29, 2019

Codecov Report

Merging #4302 into master will decrease coverage by 0.03%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4302      +/-   ##
==========================================
- Coverage   97.58%   97.55%   -0.04%     
==========================================
  Files          43       43              
  Lines        8857     8862       +5     
  Branches     1387     1389       +2     
==========================================
+ Hits         8643     8645       +2     
- Misses         91       93       +2     
- Partials      123      124       +1
Impacted Files Coverage Δ
aiohttp/web_urldispatcher.py 99.09% <100%> (-0.01%) ⬇️
aiohttp/helpers.py 96.15% <66.66%> (-0.44%) ⬇️
aiohttp/web_fileresponse.py 97.72% <0%> (-0.57%) ⬇️

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 1517e6b...b49c98f. Read the comment docs.

aiohttp/web_urldispatcher.py Outdated Show resolved Hide resolved
@yuvalof yuvalof requested a review from asvetlov October 29, 2019 14:36
@asvetlov
Copy link
Member

@yuvalof
Copy link
Contributor Author

yuvalof commented Oct 29, 2019

Fixed the pypy and merged master

@asvetlov asvetlov merged commit 2a924ca into aio-libs:master Oct 29, 2019
@asvetlov
Copy link
Member

thanks!

@nicktimko
Copy link
Contributor

Also fixes #3252

@asvetlov
Copy link
Member

asvetlov commented Nov 5, 2019

Thanks @nicktimko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants