-
-
Notifications
You must be signed in to change notification settings - Fork 857
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
Version 0.14.0 #1083
Version 0.14.0 #1083
Conversation
Other possible candidates for a 0.14.0 release...
I'm also minded to have a proper pass at polishing up the developer interface docs alongside the 0.14 release, since this release is really all about nailing that right down. There are still some very minor bits of public/private attribute polishing that we'll want to look at on some of the models. Excluding exceptions, here's how the public API shapes up after all this: Helper functions
Clients
Models
Configuration
Authentication
Transports
Status Codes
|
Hoping to roll the 0.14 release early this coming week. Here's what I think we still need to do...
Anything I'm missing? |
|
@tomchristie I won't be available most of the rest of today for reviews, neither on Monday. Is there such an urgent need to release 0.14 "ASAP"? I understand we're all excited but just an explicit heads up that I don't think this means we should bypass reviews on non-trivial changes (since I'm assuming merging w/o thorough second review would be the only way to achieve a release by tomorrow given the rest of things that need to be done). 😅 |
Yup, all fair. Let's keep it moderated. It's a great piece of work, no need for us to rush it tho. |
I think we really want this in some form that doesn't explicitly break existing codebases. If we can find a way to print a deprecation warning that's great, but if not just putting a big warning in the release notes is sufficient (yay for pre-1.0 code!). |
@iwoloschin Indeed. I think there's probably also a decent case to make for not deprecating it at all, and instead keeping it as a base class, but only for try:
response = httpx.get("https://www.example.com/") # May raise a RequestError subclass
response.raise_for_status() # May raise HTTPStatusError
except httpx.HTTPError as exc:
pass Which means existing code all keeps working as expected, while still providing finer-grained classes where needed. Also, both It's also more concise than the alternative... try:
response = httpx.get("https://www.example.com/") # May raise a RequestError subclass
response.raise_for_status() # May raise HTTPStatusError
except (httpx.RequestError, httpx.HTTPStatusError) as exc:
pass This hadn't really occurred to me when looking at #1095. |
Co-authored-by: Stephen Brown II <[email protected]>
Last bits here are...
|
0.14.0 (August 7th, 2020)
The 0.14 release includes a range of improvements to the public API, intended on preparing for our upcoming 1.0 release.
pip install httpx[http2]
if you want to include the HTTP/2 dependancies.http
tohttps
if the host is on the HSTS list can be beneficial in avoiding roundtrips to incorrectly formed URLs, but on balance we've decided to remove this feature, on the principle of least surprise. Most programmatic clients do not include HSTS support, and for now we're opting to remove our support for it.httpx.HTTPError
usage, but we've got a clearer overall structure now. See https://www.python-httpx.org/exceptions/ for more details.When upgrading you should be aware of the following public API changes. Note that deprecated usages will currently continue to function, but will issue warnings.
httpx.codes
consistently in favour ofhttpx.StatusCodes
.httpx.Timeout()
should now always include an explicit default. Eg.httpx.Timeout(None, pool=5.0)
.httpx.Timeout()
, we now have more concisely named keyword arguments. Eg.read=5.0
, instead ofread_timeout=5.0
.httpx.Limits()
instead ofhttpx.PoolLimits()
, andlimits=...
instead ofpool_limits=...
.httpx.Limits(max_keepalive=...)
argument is now deprecated in favour of a more explicithttpx.Limits(max_keepalive_connections=...)
Client(proxies={...})
should now be in the style of{"http://": ...}
, rather than{"http": ...}
.Headers.getlist()
andQueryParams.getlist()
are deprecated in favour of more consistent.get_list()
variants.URL.is_ssl
property is deprecated in favour ofURL.scheme == "https"
.URL.join(relative_url=...)
method is nowURL.join(url=...)
. This change does not support warnings for the deprecated usage style.One notable aspect of the 0.14.0 release is that it tightens up the public API for
httpx
, by ensuring that several internal attributes and methods have now become strictly private.The following previously had nominally public names on the client, but were all undocumented and intended solely for internal usage. They are all now replaced with underscored names, and should not be relied on or accessed.
These changes should not affect users who have been working from the
httpx
documentation..merge_url()
,.merge_headers()
,.merge_cookies()
,.merge_queryparams()
.build_auth()
,.build_redirect_request()
.redirect_method()
,.redirect_url()
,.redirect_headers()
,.redirect_stream()
.send_handling_redirects()
,.send_handling_auth()
,.send_single_request()
.init_transport()
,.init_proxy_transport()
.proxies
,.transport
,.netrc
,.get_proxy_map()
See pull requests #997, #1065, #1071.
Some areas of API which were already on the deprecation path, and were raising warnings or errors in 0.13.x have now been escalated to being fully removed.
ASGIDispatch
,WSGIDispatch
, which have been replaced byASGITransport
,WSGITransport
.dispatch=...`` on client, which has been replaced by
transport=...``soft_limit
,hard_limit
, which have been replaced bymax_keepalive
andmax_connections
.Response.stream
and, which have been replaced by ``.aiter_bytes
and.aiter_raw
.proxies=<transport instance>
in favor ofproxies=httpx.Proxy(...)
.See pull requests #1057, #1058.
### Added
httpx.HTTPStatusError
for.raise_for_status()
exceptions. (Pull Raise HTTPStatusError in raise_from_status #1072)httpx.create_ssl_context()
helper function. (Pull Included create_ssl_context function to create the same context with SSLConfig and serve as API #996)proxies={"https://www.example.com": None}
. (Pull Add support for no-proxy configurations #1099)QueryParams(None)
andclient.params = None
. (Pull Support QueryParams(None) #1060)Changed
httpx.codes
consistently in favour ofhttpx.StatusCodes
which is placed into deprecation. (Pull Single consistent name for status codes #1088)httpx.Timeout()
should now always include an explicit default. Eg.httpx.Timeout(None, pool=5.0)
. (Pull httpx.Timeout must include a default #1085)httpx.Timeout()
keyword arguments. Eg.read=5.0
, instead ofread_timeout=5.0
. (Pull Switch to more concise Timeout parameters #1111)httpx.Limits()
instead ofhttpx.PoolLimits()
, andlimits=...
instead ofpool_limits=...
. (Pull Rename PoolLimits to Limits #1113)httpx.Limits(max_keepalive=...)
argument is now deprecated in favour of a more explicithttpx.Limits(max_keepalive_connections=...)
.Client(proxies={...})
should now be in the style of{"http://": ...}
, rather than{"http": ...}
. (Pull Raise warning if proxy key is eg. "all" instead of "all://". #1127)Headers.getlist
andQueryParams.getlist
are deprecated in favour of more consistent.get_list()
variants. (Pull Consistent multidict methods #1089)URL.port
becomesOptional[int]
. Now only returns a port if one is explicitly included in the URL string. (Pull URL.port becomes Optional[int] #1080)URL(..., allow_relative=[bool])
parameter no longer exists. All URL instances may be relative. (Pull DropURL(allow_relative=bool)
#1073)url.full_path = ...
property setter. (Pull Drop fullpath setter #1069)URL.join(relative_url=...)
method is nowURL.join(url=...)
. (Pull Clean up keyword argument name, using URL.join(url=...), not URL.join(relative_url=...). #1129)URL.is_ssl
property is deprecated in favour ofURL.scheme == "https"
. (Pull DeprecateURL.is_ssl
#1128)Fixed
Response.next()
method. (Pull Add missingResponse.next()
#1055)Response.iter_lines()
. (Pull aiter_lines() doesn't return full lines that span multiple chunks #1033, Fixes for LineDecoding #1075).netrc
files. (Pull Ignore PermissionError in netrc_info() #1104)HTTP_PROXY
etc... environment variables. (Pull Handle bare env proxy hostname gracefully #1120)app=...
ortransport=...
bypasses any environment based proxy defaults. (Pull Settingapp=...
ortransport=...
should bypass environment proxies. #1122).base_url
when a path component is included in the base URL. (Pull Base URL improvements #1130)