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

Replace requests with aiohttp #440

Merged
merged 1 commit into from
Feb 25, 2020
Merged

Replace requests with aiohttp #440

merged 1 commit into from
Feb 25, 2020

Conversation

cooperlees
Copy link
Contributor

@cooperlees cooperlees commented Feb 24, 2020

  • Change Master to use an aiohttp ClientSession
  • Change Master.get method into an async generator to maintain API style
  • Change Package class to use Master.get async generator
  • Update utils user_agent() to always include aiohttp version + update tests
  • Make verify.py use utils common USER_AGENT

Fix most tests + add in pytest-asyncio

  • Happy to take the small % of coverage hit as I think I've covered most important parts, especially with the INTEGRATION run we do.

Fixes #6

- Change Master to use an aiohttp ClientSession
- Change Master.get method into an async generator to maintain API style
- Change Package class to use Master.get async generator
- Update utils user_agent() to always include aiohttp version + update tests
- Make `verify.py` use utils common USER_AGENT

Fix most tests + add in pytest-asyncio
@cooperlees cooperlees added enhancement New feature or request 4.0 labels Feb 24, 2020
@codecov
Copy link

codecov bot commented Feb 24, 2020

Codecov Report

Merging #440 into master will decrease coverage by 0.6%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #440      +/-   ##
==========================================
- Coverage   82.44%   81.84%   -0.61%     
==========================================
  Files          10       10              
  Lines        1128     1151      +23     
  Branches      175      177       +2     
==========================================
+ Hits          930      942      +12     
- Misses        159      166       +7     
- Partials       39       43       +4
Impacted Files Coverage Δ
src/bandersnatch/__init__.py 100% <ø> (ø) ⬆️
src/bandersnatch/verify.py 51.47% <0%> (-0.36%) ⬇️
src/bandersnatch/utils.py 95.5% <100%> (+4.49%) ⬆️
src/bandersnatch/main.py 76.82% <39.13%> (+4.1%) ⬆️
src/bandersnatch/mirror.py 86.01% <75%> (-0.84%) ⬇️
src/bandersnatch/package.py 81.2% <86.36%> (-4.24%) ⬇️
src/bandersnatch/master.py 84.26% <89.74%> (-0.46%) ⬇️

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 a7932c3...4cb5a46. Read the comment docs.

@cooperlees
Copy link
Contributor Author

I don't think anyone will ever review this. Going to merge and move forward doing the remaining 4.0 PRs and get an alpha release out maybe this week.

@cooperlees cooperlees merged commit 13ddc5b into master Feb 25, 2020
@cooperlees cooperlees deleted the aiohttp_only branch February 25, 2020 16:45
@techalchemy
Copy link
Member

I'll make sure to swap my deployments to use the alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move from threading to asyncio
2 participants