-
-
Notifications
You must be signed in to change notification settings - Fork 853
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
Add httpx.Mounts
transport class.
#3070
Conversation
httpx/_transports/mounts.py
Outdated
return True | ||
|
||
@property | ||
def priority(self) -> typing.Tuple[int, int, int]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def priority(self) -> typing.Tuple[int, int, int]: | |
def priority(self) -> tuple[int, int, int]: |
Now we support this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need CI check for this? Check out https://github.com/frostming/fix-future-annotations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kludex what do you think?
Mounts
transport class.httpx.Mounts
transport class.
pass | ||
|
||
|
||
class URLPattern: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why duplicating it from httpx._utils
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well caught... because this pull request will also include removing mounts=...
from the client, but I haven't gotten to that part yet.
It'll make more sense for all the implementation to be together in this module once the functionality is fully encompassed by httpx.Mounts()
.
Discussed in #947 (comment)
This PR adds the
Mounts
andAsyncMounts
transport classes.Currently in draft... switch
mounts=...
out of theClient
class directly.Here's the synopsis...
We currently have
mounts=...
behaviour backed directly into the client, like so...However it'd be neater to keep that complexity encapsulated within a transport class that supports routing, so...
At this point in time the pull request replicates the
mounts=...
functionality in a transport class, but doesn't yet remove it from the client. A follow-up would deal with removing it.