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

Async rendering support #393

Merged
merged 30 commits into from
Nov 12, 2020
Merged

Async rendering support #393

merged 30 commits into from
Nov 12, 2020

Conversation

Dreamsorcerer
Copy link
Member

@Dreamsorcerer Dreamsorcerer commented Nov 7, 2020

-- This is branched from the typing PR, so merge that first to reduce the diff --

This adds render_string_async() and render_template_async() functions.
It also modifies the @template decorator to use the async rendering when enable_async=True has been passed to the setup.

Fixes #333

@codecov
Copy link

codecov bot commented Nov 7, 2020

Codecov Report

Merging #393 (61295a2) into master (858bd57) will increase coverage by 0.33%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
+ Coverage   96.02%   96.36%   +0.33%     
==========================================
  Files           3        3              
  Lines         151      165      +14     
  Branches       18       19       +1     
==========================================
+ Hits          145      159      +14     
  Misses          6        6              
Flag Coverage Δ
unit 95.15% <100.00%> (+0.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiohttp_jinja2/__init__.py 95.27% <100.00%> (+0.58%) ⬆️

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 858bd57...61295a2. Read the comment docs.

@asvetlov
Copy link
Member

asvetlov commented Nov 8, 2020

Please fix the merge conflict

@Dreamsorcerer
Copy link
Member Author

OK, went a bit weird for a moment. All sorted now.

@asvetlov asvetlov merged commit 72095b9 into aio-libs:master Nov 12, 2020
@asvetlov
Copy link
Member

Awesome, I'll prepare a new release with this feature.

@Dreamsorcerer would you get write access to the repo (GitHub Maintainer role precisely).

I don't expect much work here but don't want to be a bus factor and shuffle off routine procedures on somebody else :)
Honestly, asyncio + aiohttp consumes almost all my spare time

@Dreamsorcerer
Copy link
Member Author

Yep, go ahead. Happy to keep things going.

@asvetlov
Copy link
Member

asvetlov commented Nov 12, 2020

Great!
An invitation is sent.
I would suggest you maintain https://github.com/aio-libs/aiohttp-mako
The library is pretty similar to aiohttp-jinja2 but uses the mako template engine (which is simpler than jinja2 actually).
It needs some housekeeping work (drop py3.5, add tests for 3.8-3.9, maybe something also -- I don't remember).

@Dreamsorcerer Dreamsorcerer deleted the async branch November 13, 2020 18:12
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.

Support async rendering
2 participants