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

Fixes for strict-bytes #10454

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Fixes for strict-bytes #10454

wants to merge 6 commits into from

Conversation

Dreamsorcerer
Copy link
Member

This will be default behaviour in mypy 2, so best to fix it early.

It would be good if anybody else can check over these, the existing code seems a little confused with when it wants bytes only or will allow bytes/bytearray/memoryview.

aiohttp/abc.py Outdated Show resolved Hide resolved
aiohttp/http_writer.py Outdated Show resolved Hide resolved
aiohttp/http_writer.py Outdated Show resolved Hide resolved
aiohttp/http_writer.py Outdated Show resolved Hide resolved
aiohttp/http_writer.py Outdated Show resolved Hide resolved
aiohttp/web_ws.py Outdated Show resolved Hide resolved
@Dreamsorcerer Dreamsorcerer added bot:chronographer:skip This PR does not need to include a change note backport:skip Skip backport bot labels Feb 11, 2025
@Dreamsorcerer
Copy link
Member Author

I'm unclear if the remaining errors are a bug with us or with typeshed (which says the method doesn't support memoryview[bytes]).

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.69%. Comparing base (97f5e2d) to head (982ed47).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10454   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files         122      122           
  Lines       37180    37185    +5     
  Branches     2058     2059    +1     
=======================================
+ Hits        36695    36700    +5     
  Misses        338      338           
  Partials      147      147           
Flag Coverage Δ
CI-GHA 98.58% <95.23%> (-0.01%) ⬇️
OS-Linux 98.24% <95.23%> (-0.01%) ⬇️
OS-Windows 96.18% <95.23%> (+<0.01%) ⬆️
OS-macOS 97.35% <95.23%> (-0.02%) ⬇️
Py-3.10.11 97.27% <90.47%> (+<0.01%) ⬆️
Py-3.10.16 97.81% <90.47%> (-0.01%) ⬇️
Py-3.11.11 97.90% <90.47%> (-0.01%) ⬇️
Py-3.11.9 97.35% <90.47%> (-0.01%) ⬇️
Py-3.12.8 98.35% <85.71%> (-0.01%) ⬇️
Py-3.13.1 98.34% <85.71%> (-0.01%) ⬇️
Py-3.13.2 97.32% <85.71%> (?)
Py-3.9.13 97.16% <90.47%> (-0.01%) ⬇️
Py-3.9.21 97.69% <90.47%> (-0.01%) ⬇️
Py-pypy7.3.16 97.29% <90.47%> (-0.01%) ⬇️
VM-macos 97.35% <95.23%> (-0.02%) ⬇️
VM-ubuntu 98.24% <95.23%> (-0.01%) ⬇️
VM-windows 96.18% <95.23%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codspeed-hq bot commented Feb 11, 2025

CodSpeed Performance Report

Merging #10454 will improve performances by 12.08%

Comparing strict-bytes (982ed47) with master (97f5e2d)

Summary

⚡ 1 improvements
✅ 47 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
test_one_hundred_get_requests_iter_chunks_on_512kib_chunked_payload[pyloop] 108.3 ms 96.6 ms +12.08%

@asvetlov
Copy link
Member

Would you backport the PR

@Dreamsorcerer
Copy link
Member Author

Would you backport the PR

It changes the (apparent) API, so I'd prefer to avoid it. Hopefully will be focusing on v4 after the typing work I'm doing.

@asvetlov
Copy link
Member

Up to you, any decision is good to me.

@asvetlov
Copy link
Member

asvetlov commented Feb 11, 2025

Yes, focusing on V4 would be good.

Personally, I should review the diff and file a list of required changes related to my commits on master that were not backported.
I have quite a tight schedule this month; but the task is in my to-do list.

@Dreamsorcerer
Copy link
Member Author

I'm unclear if the remaining errors are a bug with us or with typeshed (which says the method doesn't support memoryview[bytes]).

@bdraco I think you've played with that code fairly recently, any idea if memoryview[bytes] is actually supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip Skip backport bot bot:chronographer:skip This PR does not need to include a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants