horazont / aioopenssl

(START-)TLS-capable transport using OpenSSL for asyncio
Apache License 2.0
15 stars 7 forks source link

Replace BaseEventLoop with AbstractEventLoop #16

Closed freundTech closed 2 years ago

freundTech commented 2 years ago

This is needed for the type annotations to work correctly with type-checkers.

asyncio.get_event_loop(), asyncio.get_running_loop() and similar functions all return AbstractEventLoop, leading to a type error if one tries to pass their return value to this library.

See https://github.com/python/typeshed/blob/master/stdlib/asyncio/events.pyi#L527

horazont commented 2 years ago

@freundTech Hi! Thanks for the PR - I completely missed the notification though.

Before we go further, could you please include your PR description (as 72-char wide line-wrapped text) in the commit message? That would be most appreciated in order to have all necessary context for a change easily reachable from git log.

Thanks!

freundTech commented 2 years ago

Done! I also replace the link to typeshed, as the line numbers had changed. I've now linked to a fixed revision.

horazont commented 2 years ago

@freundTech Thanks! Now I can even trigger the pipeline run \o/. Could you maybe add the line wrapping to the commit message and leave blanks between the paragraphs?

freundTech commented 2 years ago

I updated the commit message again and fixed the mypy and lint errors (mypy was complaining about an unused # type: ignore and flake8 about a line to long in inline documentation)

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.0%) to 67.285% when pulling 5dbff8462578a874ab59a1c10b842e5a10361eaa on freundTech:fix-abstract-event-loop-annotation into 4726f0063bf0024f92245c1d47a1f03e5b88085e on horazont:devel.

horazont commented 2 years ago

Thanks a lot!