Thu Oct 21 13:16:15 2021 UTC ()
py-httpx: updated to 0.20.0

0.20.0:

Changed

* The `allow_redirects` flag is now `follow_redirects` and defaults to `False`.
* The `raise_for_status()` method will now raise an exception for any responses
  except those with 2xx status codes. Previously only 4xx and 5xx status codes
  would result in an exception.
* The low-level transport API changes to the much simpler `response = transport.handle_request(request)`.
* The `client.send()` method no longer accepts a `timeout=...` argument, but the
  `client.build_request()` does. This required by the signature change of the
  Transport API. The request timeout configuration is now stored on the request
  instance, as `request.extensions['timeout']`.

Added

* Added the `httpx` command-line client.
* Response instances now include `.is_informational`, `.is_success`, `.is_redirect`, `.is_client_error`, and `.is_server_error`
  properties for checking 1xx, 2xx, 3xx, 4xx, and 5xx response types. Note that the behaviour of `.is_redirect` is slightly different in that it now returns True for all 3xx responses, in order to allow for a consistent set of properties onto the different HTTP status code types. The `response.has_redirect_location` location may be used to determine responses with properly formed URL redirects.

Fixed

* `response.iter_bytes()` no longer raises a ValueError when called on a response with no content.
* The `'wsgi.error'` configuration now defaults to `sys.stderr`, and is corrected to be a `TextIO` interface, not a `BytesIO` interface. Additionally, the WSGITransport now accepts a `wsgi_error` confguration.
* Follow the WSGI spec by properly closing the iterable returned by the application.


(adam)
diff -r0 -r1.1 pkgsrc/www/py-httpx/ALTERNATIVES
diff -r1.14 -r1.15 pkgsrc/www/py-httpx/Makefile
diff -r1.7 -r1.8 pkgsrc/www/py-httpx/PLIST
diff -r1.15 -r1.16 pkgsrc/www/py-httpx/distinfo

File Added: pkgsrc/www/py-httpx/ALTERNATIVES
bin/httpx @PREFIX@/bin/httpx-@PYVERSSUFFIX@

cvs diff -r1.14 -r1.15 pkgsrc/www/py-httpx/Makefile (expand / switch to context diff)
--- pkgsrc/www/py-httpx/Makefile 2021/08/25 19:20:56 1.14
+++ pkgsrc/www/py-httpx/Makefile 2021/10/21 13:16:15 1.15
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.14 2021/08/25 19:20:56 adam Exp $
+# $NetBSD: Makefile,v 1.15 2021/10/21 13:16:15 adam Exp $
 
-DISTNAME=	httpx-0.19.0
+DISTNAME=	httpx-0.20.0
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=	www python
 MASTER_SITES=	${MASTER_SITE_PYPI:=h/httpx/}
@@ -11,6 +11,7 @@
 LICENSE=	modified-bsd
 
 DEPENDS+=	${PYPKGPREFIX}-certifi-[0-9]*:../../security/py-certifi
+DEPENDS+=	${PYPKGPREFIX}-charset-normalizer-[0-9]*:../../converters/py-charset-normalizer
 DEPENDS+=	${PYPKGPREFIX}-httpcore>=0.13.3:../../www/py-httpcore
 DEPENDS+=	${PYPKGPREFIX}-rfc3986>=1.3:../../www/py-rfc3986
 DEPENDS+=	${PYPKGPREFIX}-sniffio-[0-9]*:../../misc/py-sniffio
@@ -18,6 +19,10 @@
 USE_LANGUAGES=	# none
 
 PYTHON_VERSIONS_INCOMPATIBLE=	27 36 # py-httpcore, py-anyio, py-uvloop
+
+post-install:
+	cd ${DESTDIR}${PREFIX}/bin && \
+	${MV} httpx httpx-${PYVERSSUFFIX} || ${TRUE}
 
 .include "../../lang/python/egg.mk"
 .include "../../mk/bsd.pkg.mk"

cvs diff -r1.7 -r1.8 pkgsrc/www/py-httpx/PLIST (expand / switch to context diff)
--- pkgsrc/www/py-httpx/PLIST 2021/05/08 08:58:42 1.7
+++ pkgsrc/www/py-httpx/PLIST 2021/10/21 13:16:15 1.8
@@ -1,7 +1,9 @@
-@comment $NetBSD: PLIST,v 1.7 2021/05/08 08:58:42 adam Exp $
+@comment $NetBSD: PLIST,v 1.8 2021/10/21 13:16:15 adam Exp $
+bin/httpx-${PYVERSSUFFIX}
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
 ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
+${PYSITELIB}/${EGG_INFODIR}/entry_points.txt
 ${PYSITELIB}/${EGG_INFODIR}/not-zip-safe
 ${PYSITELIB}/${EGG_INFODIR}/requires.txt
 ${PYSITELIB}/${EGG_INFODIR}/top_level.txt
@@ -35,6 +37,9 @@
 ${PYSITELIB}/httpx/_exceptions.py
 ${PYSITELIB}/httpx/_exceptions.pyc
 ${PYSITELIB}/httpx/_exceptions.pyo
+${PYSITELIB}/httpx/_main.py
+${PYSITELIB}/httpx/_main.pyc
+${PYSITELIB}/httpx/_main.pyo
 ${PYSITELIB}/httpx/_models.py
 ${PYSITELIB}/httpx/_models.pyc
 ${PYSITELIB}/httpx/_models.pyo

cvs diff -r1.15 -r1.16 pkgsrc/www/py-httpx/distinfo (expand / switch to context diff)
--- pkgsrc/www/py-httpx/distinfo 2021/10/07 15:08:27 1.15
+++ pkgsrc/www/py-httpx/distinfo 2021/10/21 13:16:15 1.16
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.15 2021/10/07 15:08:27 nia Exp $
+$NetBSD: distinfo,v 1.16 2021/10/21 13:16:15 adam Exp $
 
-RMD160 (httpx-0.19.0.tar.gz) = eab8dcf20bc4f4b776b11be05c7fd305e500381f
+RMD160 (httpx-0.20.0.tar.gz) = 7ffca594ca3a52c6f3a97057f3e3cfeb1cf3d9e6
-SHA512 (httpx-0.19.0.tar.gz) = ebf8f40424e43d8fcb41e1547e532210a956deae6649e80b3963c46dd12bb630358fa0d330e88242705e0908b09635d0dc17d4f75779f25903f7073c16d756d2
+SHA512 (httpx-0.20.0.tar.gz) = 8f05df5c7e8f5e21ee68d00c32da29e258575f7af3963da4e4fd37548e2bbdc5a5e821ea32f63479035e81ba0946987f7e4ab6bf78f68555a5a2f731e51226e1
-Size (httpx-0.19.0.tar.gz) = 97592 bytes
+Size (httpx-0.20.0.tar.gz) = 104549 bytes