pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/py-httpx py-httpx: updated to 0.15.4



details:   https://anonhg.NetBSD.org/pkgsrc/rev/064e61f6d9d3
branches:  trunk
changeset: 439969:064e61f6d9d3
user:      adam <adam%pkgsrc.org@localhost>
date:      Thu Oct 01 06:51:31 2020 +0000

description:
py-httpx: updated to 0.15.4

0.15.4

Added
* Support direct comparisons between `Headers` and dicts or lists of two-tuples. Eg. `assert response.headers == {"Content-Length": 24}`

Fixed
* Fix automatic `.read()` when `Response` instances are created with `content=<str>`


0.15.3

Fixed
* Fixed connection leak in async client due to improper closing of response streams.

0.15.2

Fixed
* Fixed `response.elapsed` property.
* Fixed client authentication interaction with `.stream()`.


0.15.1

Fixed
* ASGITransport now properly applies URL decoding to the `path` component, as-per the ASGI spec.


0.15.0

Added
* Added support for curio. (Pull https://github.com/encode/httpcore/pull/168)
* Added support for event hooks.
* Added support for authentication flows which require either sync or async I/O.
* Added support for monitoring download progress with `response.num_bytes_downloaded`.
* Added `Request(content=...)` for byte content, instead of overloading `Request(data=...)`
* Added support for all URL components as parameter names when using `url.copy_with(...)`.
* Neater split between automatically populated headers on `Request` instances, vs default `client.headers`.
* Unclosed `AsyncClient` instances will now raise warnings if garbage collected.
* Support `Response(content=..., text=..., html=..., json=...)` for creating usable response instances in code.
* Support instantiating requests from the low-level transport API.
* Raise errors on invalid URL types.

Changed
* Cleaned up expected behaviour for URL escaping. `url.path` is now URL escaped.
* Cleaned up expected behaviour for bytes vs str in URL components. `url.userinfo` and `url.query` are not URL escaped, and so return bytes.
* Drop `url.authority` property in favour of `url.netloc`, since "authority" was semantically incorrect.
* Drop `url.full_path` property in favour of `url.raw_path`, for better consistency with other parts of the API.
* No longer use the `chardet` library for auto-detecting charsets, instead defaulting to a simpler approach when no charset is specified.

Fixed
* Swapped ordering of redirects and authentication flow.
* `.netrc` lookups should use host, not host+port.

Removed
* The `URLLib3Transport` class no longer exists. We've published it instead as an example of [a custom transport class](https://gist.github.com/florimondmanca/d56764d78d748eb9f73165da388e546e).
* Drop `request.timer` attribute, which was being used internally to set `response.elapsed`.
* Drop `response.decoder` attribute, which was being used internally.
* `Request.prepare()` is now a private method.
* The `Headers.getlist()` method had previously been deprecated in favour of `Headers.get_list()`. It is now fully removed.
* The `QueryParams.getlist()` method had previously been deprecated in favour of `QueryParams.get_list()`. It is now fully removed.
* The `URL.is_ssl` property had previously been deprecated in favour of `URL.scheme == "https"`. It is now fully removed.
* The `httpx.PoolLimits` class had previously been deprecated in favour of `httpx.Limits`. It is now fully removed.
* The `max_keepalive` setting had previously been deprecated in favour of the more explicit `max_keepalive_connections`. It is now fully removed.
* The verbose `httpx.Timeout(5.0, connect_timeout=60.0)` style had previously been deprecated in favour of `httpx.Timeout(5.0, connect=60.0)`. It is now fully removed.
* Support for instantiating a timeout config missing some defaults, such as `httpx.Timeout(connect=60.0)`, had previously been deprecated in favour of enforcing a more explicit style, such as 
`httpx.Timeout(5.0, connect=60.0)`. This is now strictly enforced.


0.14.3

Added
* `http.Response()` may now be instantiated without a `request=...` parameter. Useful for some unit testing cases.
* Add `103 Early Hints` and `425 Too Early` status codes.

Fixed
* `DigestAuth` now handles responses that include multiple 'WWW-Authenticate' headers.
* Call into transport `__enter__`/`__exit__` or `__aenter__`/`__aexit__` when client is used in a context manager style.


0.14.2

Added
* Support `client.get(..., auth=None)` to bypass the default authentication on a clients.
* Support `client.auth = ...` property setter.
* Support `httpx.get(..., proxies=...)` on top-level request functions.
* Display instances with nicer import styles. (Eg. <httpx.ReadTimeout ...>)
* Support `cookies=[(key, value)]` list-of-two-tuples style usage.

Fixed
* Ensure that automatically included headers on a request may be modified.
* Allow explicit `Content-Length` header on streaming requests.
* Handle URL quoted usernames and passwords properly.
* Use more consistent default for `HEAD` requests, setting `allow_redirects=True`.
* If a transport error occurs while streaming the response, raise an `httpx` exception, not the underlying `httpcore` exception.
* Include the underlying `httpcore` traceback, when transport exceptions occur.

0.14.1

Added
* The `httpx.URL(...)` class now raises `httpx.InvalidURL` on invalid URLs, rather than exposing the underlying `rfc3986` exception. If a redirect response includes an invalid 'Location' header, then 
a `RemoteProtocolError` exception is raised, which will be associated with the request that caused it.

Fixed
* Handling multiple `Set-Cookie` headers became broken in the 0.14.0 release, and is now resolved.


0.14.0

The 0.14 release includes a range of improvements to the public API, intended on preparing for our upcoming 1.0 release.

* Our HTTP/2 support is now fully optional. **You now need to use `pip install httpx[http2]` if you want to include the HTTP/2 dependancies.**
* Our HSTS support has now been removed. Rewriting URLs from `http` to `https` 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.
* Our exception hierarchy has been overhauled. Most users will want to stick with their existing `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.

* You should now use `httpx.codes` consistently instead of `httpx.StatusCodes`.
* Usage of `httpx.Timeout()` should now always include an explicit default. Eg. `httpx.Timeout(None, pool=5.0)`.
* When using `httpx.Timeout()`, we now have more concisely named keyword arguments. Eg. `read=5.0`, instead of `read_timeout=5.0`.
* Use `httpx.Limits()` instead of `httpx.PoolLimits()`, and `limits=...` instead of `pool_limits=...`.
* The `httpx.Limits(max_keepalive=...)` argument is now deprecated in favour of a more explicit `httpx.Limits(max_keepalive_connections=...)`.
* Keys used with `Client(proxies={...})` should now be in the style of `{"http://": ...}`, rather than `{"http": ...}`.
* The multidict methods `Headers.getlist()` and `QueryParams.getlist()` are deprecated in favour of more consistent `.get_list()` variants.
* The `URL.is_ssl` property is deprecated in favour of `URL.scheme == "https"`.
* The `URL.join(relative_url=...)` method is now `URL.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()`

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.

* Drop `ASGIDispatch`, `WSGIDispatch`, which have been replaced by `ASGITransport`, `WSGITransport`.
* Drop `dispatch=...`` on client, which has been replaced by `transport=...``
* Drop `soft_limit`, `hard_limit`, which have been replaced by `max_keepalive` and `max_connections`.
* Drop `Response.stream` and` `Response.raw`, which have been replaced by ``.aiter_bytes` and `.aiter_raw`.
* Drop `proxies=<transport instance>` in favor of `proxies=httpx.Proxy(...)`.

Added
* Added dedicated exception class `httpx.HTTPStatusError` for `.raise_for_status()` exceptions.
* Added `httpx.create_ssl_context()` helper function.
* Support for proxy exlcusions like `proxies={"https://www.example.com": None}`.
* Support `QueryParams(None)` and `client.params = None`.

Changed
* Use `httpx.codes` consistently in favour of `httpx.StatusCodes` which is placed into deprecation.
* Usage of `httpx.Timeout()` should now always include an explicit default. Eg. `httpx.Timeout(None, pool=5.0)`.
* Switch to more concise `httpx.Timeout()` keyword arguments. Eg. `read=5.0`, instead of `read_timeout=5.0`.
* Use `httpx.Limits()` instead of `httpx.PoolLimits()`, and `limits=...` instead of `pool_limits=...`.
* Keys used with `Client(proxies={...})` should now be in the style of `{"http://": ...}`, rather than `{"http": ...}`.
* The multidict methods `Headers.getlist` and `QueryParams.getlist` are deprecated in favour of more consistent `.get_list()` variants.
* `URL.port` becomes `Optional[int]`. Now only returns a port if one is explicitly included in the URL string.
* The `URL(..., allow_relative=[bool])` parameter no longer exists. All URL instances may be relative.
* Drop unnecessary `url.full_path = ...` property setter.
* The `URL.join(relative_url=...)` method is now `URL.join(url=...)`.
* The `URL.is_ssl` property is deprecated in favour of `URL.scheme == "https"`.

Fixed
* Add missing `Response.next()` method.
* Ensure all exception classes are exposed as public API.
* Support multiple items with an identical field name in multipart encodings.
* Skip HSTS preloading on single-label domains.
* Fixes for `Response.iter_lines()`.
* Ignore permission errors when accessing `.netrc` files.
* Allow bare hostnames in `HTTP_PROXY` etc... environment variables.
* Settings `app=...` or `transport=...` bypasses any environment based proxy defaults.
* Fix handling of `.base_url` when a path component is included in the base URL.

diffstat:

 www/py-httpx/Makefile |   9 +++------
 www/py-httpx/PLIST    |  14 +++++++-------
 www/py-httpx/distinfo |  10 +++++-----
 3 files changed, 15 insertions(+), 18 deletions(-)

diffs (81 lines):

diff -r 0d7a5f2c28d8 -r 064e61f6d9d3 www/py-httpx/Makefile
--- a/www/py-httpx/Makefile     Thu Oct 01 06:48:37 2020 +0000
+++ b/www/py-httpx/Makefile     Thu Oct 01 06:51:31 2020 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.6 2020/06/03 14:21:26 adam Exp $
+# $NetBSD: Makefile,v 1.7 2020/10/01 06:51:31 adam Exp $
 
-DISTNAME=      httpx-0.13.3
+DISTNAME=      httpx-0.15.4
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    www python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=h/httpx/}
@@ -11,10 +11,7 @@
 LICENSE=       modified-bsd
 
 DEPENDS+=      ${PYPKGPREFIX}-certifi-[0-9]*:../../security/py-certifi
-DEPENDS+=      ${PYPKGPREFIX}-chardet>=3.0.0:../../converters/py-chardet
-DEPENDS+=      ${PYPKGPREFIX}-httpcore>=0.9.0:../../www/py-httpcore
-DEPENDS+=      ${PYPKGPREFIX}-hstspreload-[0-9]*:../../www/py-hstspreload
-DEPENDS+=      ${PYPKGPREFIX}-idna>=2.0:../../www/py-idna
+DEPENDS+=      ${PYPKGPREFIX}-httpcore>=0.11.0:../../www/py-httpcore
 DEPENDS+=      ${PYPKGPREFIX}-rfc3986>=1.3:../../www/py-rfc3986
 DEPENDS+=      ${PYPKGPREFIX}-sniffio-[0-9]*:../../misc/py-sniffio
 
diff -r 0d7a5f2c28d8 -r 064e61f6d9d3 www/py-httpx/PLIST
--- a/www/py-httpx/PLIST        Thu Oct 01 06:48:37 2020 +0000
+++ b/www/py-httpx/PLIST        Thu Oct 01 06:51:31 2020 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2020/06/03 14:21:26 adam Exp $
+@comment $NetBSD: PLIST,v 1.5 2020/10/01 06:51:31 adam Exp $
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
 ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
@@ -23,9 +23,9 @@
 ${PYSITELIB}/httpx/_config.py
 ${PYSITELIB}/httpx/_config.pyc
 ${PYSITELIB}/httpx/_config.pyo
-${PYSITELIB}/httpx/_content_streams.py
-${PYSITELIB}/httpx/_content_streams.pyc
-${PYSITELIB}/httpx/_content_streams.pyo
+${PYSITELIB}/httpx/_content.py
+${PYSITELIB}/httpx/_content.pyc
+${PYSITELIB}/httpx/_content.pyo
 ${PYSITELIB}/httpx/_decoders.py
 ${PYSITELIB}/httpx/_decoders.pyc
 ${PYSITELIB}/httpx/_decoders.pyo
@@ -35,6 +35,9 @@
 ${PYSITELIB}/httpx/_models.py
 ${PYSITELIB}/httpx/_models.pyc
 ${PYSITELIB}/httpx/_models.pyo
+${PYSITELIB}/httpx/_multipart.py
+${PYSITELIB}/httpx/_multipart.pyc
+${PYSITELIB}/httpx/_multipart.pyo
 ${PYSITELIB}/httpx/_status_codes.py
 ${PYSITELIB}/httpx/_status_codes.pyc
 ${PYSITELIB}/httpx/_status_codes.pyo
@@ -44,9 +47,6 @@
 ${PYSITELIB}/httpx/_transports/asgi.py
 ${PYSITELIB}/httpx/_transports/asgi.pyc
 ${PYSITELIB}/httpx/_transports/asgi.pyo
-${PYSITELIB}/httpx/_transports/urllib3.py
-${PYSITELIB}/httpx/_transports/urllib3.pyc
-${PYSITELIB}/httpx/_transports/urllib3.pyo
 ${PYSITELIB}/httpx/_transports/wsgi.py
 ${PYSITELIB}/httpx/_transports/wsgi.pyc
 ${PYSITELIB}/httpx/_transports/wsgi.pyo
diff -r 0d7a5f2c28d8 -r 064e61f6d9d3 www/py-httpx/distinfo
--- a/www/py-httpx/distinfo     Thu Oct 01 06:48:37 2020 +0000
+++ b/www/py-httpx/distinfo     Thu Oct 01 06:51:31 2020 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.6 2020/06/03 14:21:26 adam Exp $
+$NetBSD: distinfo,v 1.7 2020/10/01 06:51:31 adam Exp $
 
-SHA1 (httpx-0.13.3.tar.gz) = 37906a156699303a108bb8e1e8fe8442152c4269
-RMD160 (httpx-0.13.3.tar.gz) = 53753cf6e3a7f7a074903c6023c819ca5192be69
-SHA512 (httpx-0.13.3.tar.gz) = 4c71614bc4910363ac8c3617f5ffb44cd0ab60f9a0736588f13f91e7bef2cc9c84b8e4b1b01c46f1e2af52945ccd627448e2f35bab3d16291d02c27feb7f611c
-Size (httpx-0.13.3.tar.gz) = 59369 bytes
+SHA1 (httpx-0.15.4.tar.gz) = 463ec1f2555305ab509f59254ff08e1279f8dbd1
+RMD160 (httpx-0.15.4.tar.gz) = 1450476f35ca50a49b52913e2ab59613d206ef87
+SHA512 (httpx-0.15.4.tar.gz) = bf392829e132451a9014f76d255c337209dc9f7fd2b40a586cb18c1d97ceb61ecee023235c40d8cbf2fe84a45b88e9de0ecc4f70e88471615471b88f9773b3f8
+Size (httpx-0.15.4.tar.gz) = 82006 bytes



Home | Main Index | Thread Index | Old Index