Skip to content

Conversation

@mirthebeijers
Copy link

Summary

Hi, this is my first contribution!!! Please be a little gentle with me ;-)

This is based on #3664 but I add fixes for

  • in the test suite deprecations are marked as fatal, and uvicorn is used to set up the tests, and uvicorn generates a deprecation warning because of iscoroutinefunction()
  • uvicorn is about to create a new release with a fix: Support Python 3.14 Kludex/uvicorn#2723 👀Python 3.14 has stricter requirements for event loops in background threads. The original code in httpx called server.run() which internally uses asyncio.run(), but this doesn't work properly in background threads in Python 3.14.
  • asyncio.get_event_loop() deprecated: The TestServer.serve() method was using asyncio.get_event_loop() which is now more restrictive in Python 3.14.

I'm not fully sure if this also passes on 3.9, it might need a little more work, but on 3.14 I think this fixes the problems ;-)

Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://pypi.org/project/uvicorn is currently 0.38.0

# See: https://github.com/agronholm/anyio/issues/508
"ignore: trio.MultiError is deprecated since Trio 0.22.0:trio.TrioDeprecationWarning"
"ignore: trio.MultiError is deprecated since Trio 0.22.0:trio.TrioDeprecationWarning",
# Python 3.14 deprecates asyncio.iscoroutinefunction, but uvicorn 0.35.0 still uses it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://pypi.org/project/uvicorn is currently 0.38.0

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.

3 participants