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

Improve typing against Trio #239

Closed
wants to merge 1 commit into from
Closed

Conversation

jakkdl
Copy link
Contributor

@jakkdl jakkdl commented Jun 4, 2024

After changes to typing in upstream trio, end users have been getting typing errors due to the type on TaskStatus. This would've been caught if the mypy test environment had trio as a dependency. So this PR fixes those type errors, updates tox & mypy configs to check against trio, and adds/updates/fixes lots of other minor annotations.

This also caught a presumed typo in "lifspan.startup.complete" missing an "e" in a test.

It doesn't seem great that this project is maintaining its own set of types for the ASGI reference, I've discussed this a bit in django/asgiref#460. If you're up for it I'd love to throw out src/hypercorn/typing.py and replace it with a dependency on the asgi-types package (after updating it).

Hopefully h11 will push a release so the ~dozen of type errors introduced by that can be ignored: python-hyper/h11#175

@pgjones
Copy link
Owner

pgjones commented Jun 4, 2024

Thanks, I've merged manually with a few tweaks in 84d06b8

...replace it with a dependency on the asgi-types package...

I don't wish to add any more dependencies for Hypercorn. I do intend to update Hypercorn's types when I review the ASGI spec (hence why I've removed the changes for now).

Hopefully h11 will push a release...

I will get to h11 soon, I should now have enough access to make the hyper projects easier to maintain.

@pgjones pgjones closed this Jun 4, 2024
@jakkdl jakkdl deleted the trio_typing_dep branch June 4, 2024 21:54
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.

2 participants