From nobody Sat Nov 19 08:18:01 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NDmk249z3z4jFJ8; Sat, 19 Nov 2022 08:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NDmk20w9Yz4L29; Sat, 19 Nov 2022 08:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668845882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tTzGkPNjcvao65JGqtvBQKzB1OALnGLA+BnrHTkZcLk=; b=m/PCB3WG3njPM4gl/4QqNaDYDSXzBdEZO8StZ/uUGz3R00UwTZ1/RbfffA1Ac44QsUZfu6 RsVqtNmkleMIzGOdGIxcqUvTJv7QMpBacSBY+XXwS59uZDIuO+fh5XHxX5YfyWCZUKqhh/ GJdXVCkkuK0YTAmNy8WJ2IyribI2HKEsS01yJ86xELUVtod6CFnwE7yKZBHgqMCp89SoNi DusVNJXEznycHCPdn/IkQF4qMGVna+8OdkydN9L6oYbLe1ZuWsp7zLzIhBQbyH7pJyqAiW 2RX29BhOVYLjPNL0TvH29KnUMCO+nTwB+/nBLiDPD/YdhpoTJl2yNWgFKguonQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668845882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tTzGkPNjcvao65JGqtvBQKzB1OALnGLA+BnrHTkZcLk=; b=cmQ3HIrS67fWHz4eSSSXypVRAySD5YuHP473cOlsIKHfNv6c4K0SRObHp/MdTCd3h58I6D yB0zo6OGuEJ1+cI+za0JcE/x4OmLmJIDsFrvzNDG+rwow+iigvgz1qIxYPnIcbKBKl4QQX PGn3KEtL5nhkP969ItKm8QV5JaOK1TdWP4EK5HnsvDMpojUTmZhzIf5wlg7medSm6U9BNy g0X5V1lBMXi+ZezCDBHFFM5Q5Dap0K1nN4cZgLTTtGY78++asjoDjdANnDL0VMFOghh2IU LYhTjdqAApZMqGiPe/Dmvc1hVYOIVRXhqTx17BslYZ/N/hvf1+Lso36v/aA3bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668845882; a=rsa-sha256; cv=none; b=FKtmH0pf6zW6IsPkbxgWiiYjYgNksfHwKSJOIHFFZUsC1/R7X25YR0faFJeTr79DvQVZlc WF9PhFGCuki5YQWAgB6ED3tJE4pNpxhSt0pyWrSbHQaoh9DMIXjVRr4kAhEPpOrXcD6gR1 1K3hIltIhZBR/2/itqI3iOnlS98oY09PKLr0ytcI+MPdZFmDqwTZcVmiSZCM40HTzY32rR 4jb16ZzwmK6evIn/xkzMTFRxcEbx0g95Dm6Iyso7Xo879e/K8vTmK5Q9bfK4AKcE6pCw+6 B4q4nTQDDpAIE3bWlntrDSDXlqqsZdxljG4kXK07qKrBgvQaEZJdHtAnD1wyNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NDmk1613CzdsV; Sat, 19 Nov 2022 08:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AJ8I1Ni014853; Sat, 19 Nov 2022 08:18:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AJ8I1EQ014852; Sat, 19 Nov 2022 08:18:01 GMT (envelope-from git) Date: Sat, 19 Nov 2022 08:18:01 GMT Message-Id: <202211190818.2AJ8I1EQ014852@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 255ca6bac8ef - main - www/py-httpcore: Fix build after 7f9c0a770d4cb27d603401d526f22c3abc310db6 (py-h11 0.14.0 update) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 255ca6bac8ef59c39a98b96c5d92dc03cab97f77 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=255ca6bac8ef59c39a98b96c5d92dc03cab97f77 commit 255ca6bac8ef59c39a98b96c5d92dc03cab97f77 Author: Po-Chuan Hsieh AuthorDate: 2022-11-19 08:13:09 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-11-19 08:13:09 +0000 www/py-httpcore: Fix build after 7f9c0a770d4cb27d603401d526f22c3abc310db6 (py-h11 0.14.0 update) - Bump PORTREVISION for package change Obtained from: https://github.com/encode/httpcore/commit/4cf288e0007cb73561b9020af9228f076ba2a94e Reference: http://beefy18.nyi.freebsd.org/data/main-amd64-default/p97fda7e3a598_s813c5b75e6/logs/py39-httpcore-0.15.0.log --- www/py-httpcore/Makefile | 3 +- .../files/patch-httpcore-_async-http11.py | 78 ++++++++++++++++++++++ .../files/patch-httpcore-_sync-http11.py | 78 ++++++++++++++++++++++ www/py-httpcore/files/patch-setup.py | 6 +- 4 files changed, 162 insertions(+), 3 deletions(-) diff --git a/www/py-httpcore/Makefile b/www/py-httpcore/Makefile index 1b15b44ae54c..6d80408f8123 100644 --- a/www/py-httpcore/Makefile +++ b/www/py-httpcore/Makefile @@ -1,5 +1,6 @@ PORTNAME= httpcore PORTVERSION= 0.15.0 +PORTREVISION= 1 CATEGORIES= www python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -13,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}anyio>=3.0<4:devel/py-anyio@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}certifi>=0:security/py-certifi@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}h11>=0.11<0.14:net/py-h11@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}h11>=0.13<0.15:net/py-h11@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}sniffio>=1.0<2:devel/py-sniffio@${PY_FLAVOR} USES= python:3.7+ diff --git a/www/py-httpcore/files/patch-httpcore-_async-http11.py b/www/py-httpcore/files/patch-httpcore-_async-http11.py new file mode 100644 index 000000000000..41c562a0ec95 --- /dev/null +++ b/www/py-httpcore/files/patch-httpcore-_async-http11.py @@ -0,0 +1,78 @@ +Obtained from: https://github.com/encode/httpcore/commit/4cf288e0007cb73561b9020af9228f076ba2a94e + +--- httpcore/_async/http11.py.orig 2022-05-17 12:45:06 UTC ++++ httpcore/_async/http11.py +@@ -1,7 +1,16 @@ + import enum + import time + from types import TracebackType +-from typing import AsyncIterable, AsyncIterator, List, Optional, Tuple, Type, Union ++from typing import ( ++ AsyncIterable, ++ AsyncIterator, ++ List, ++ Optional, ++ Tuple, ++ Type, ++ Union, ++ cast, ++) + + import h11 + +@@ -17,13 +26,11 @@ from .._trace import Trace + from ..backends.base import AsyncNetworkStream + from .interfaces import AsyncConnectionInterface + +-H11Event = Union[ ++# A subset of `h11.Event` types supported by `_send_event` ++H11SendEvent = Union[ + h11.Request, +- h11.Response, +- h11.InformationalResponse, + h11.Data, + h11.EndOfMessage, +- h11.ConnectionClosed, + ] + + +@@ -127,14 +134,14 @@ class AsyncHTTP11Connection(AsyncConnectionInterface): + event = h11.Data(data=chunk) + await self._send_event(event, timeout=timeout) + +- event = h11.EndOfMessage() +- await self._send_event(event, timeout=timeout) ++ await self._send_event(h11.EndOfMessage(), timeout=timeout) + + async def _send_event( +- self, event: H11Event, timeout: Optional[float] = None ++ self, event: h11.Event, timeout: Optional[float] = None + ) -> None: + bytes_to_send = self._h11_state.send(event) +- await self._network_stream.write(bytes_to_send, timeout=timeout) ++ if bytes_to_send is not None: ++ await self._network_stream.write(bytes_to_send, timeout=timeout) + + # Receiving the response... + +@@ -168,7 +175,9 @@ class AsyncHTTP11Connection(AsyncConnectionInterface): + elif isinstance(event, (h11.EndOfMessage, h11.PAUSED)): + break + +- async def _receive_event(self, timeout: Optional[float] = None) -> H11Event: ++ async def _receive_event( ++ self, timeout: Optional[float] = None ++ ) -> Union[h11.Event, Type[h11.PAUSED]]: + while True: + with map_exceptions({h11.RemoteProtocolError: RemoteProtocolError}): + event = self._h11_state.next_event() +@@ -192,7 +201,8 @@ class AsyncHTTP11Connection(AsyncConnectionInterface): + + self._h11_state.receive_data(data) + else: +- return event ++ # mypy fails to narrow the type in the above if statement above ++ return cast(Union[h11.Event, Type[h11.PAUSED]], event) + + async def _response_closed(self) -> None: + async with self._state_lock: diff --git a/www/py-httpcore/files/patch-httpcore-_sync-http11.py b/www/py-httpcore/files/patch-httpcore-_sync-http11.py new file mode 100644 index 000000000000..3091478c3ac3 --- /dev/null +++ b/www/py-httpcore/files/patch-httpcore-_sync-http11.py @@ -0,0 +1,78 @@ +Obtained from: https://github.com/encode/httpcore/commit/4cf288e0007cb73561b9020af9228f076ba2a94e + +--- httpcore/_sync/http11.py.orig 2022-05-17 12:45:06 UTC ++++ httpcore/_sync/http11.py +@@ -1,7 +1,16 @@ + import enum + import time + from types import TracebackType +-from typing import Iterable, Iterator, List, Optional, Tuple, Type, Union ++from typing import ( ++ Iterable, ++ Iterator, ++ List, ++ Optional, ++ Tuple, ++ Type, ++ Union, ++ cast, ++) + + import h11 + +@@ -17,13 +26,11 @@ from .._trace import Trace + from ..backends.base import NetworkStream + from .interfaces import ConnectionInterface + +-H11Event = Union[ ++# A subset of `h11.Event` types supported by `_send_event` ++H11SendEvent = Union[ + h11.Request, +- h11.Response, +- h11.InformationalResponse, + h11.Data, + h11.EndOfMessage, +- h11.ConnectionClosed, + ] + + +@@ -127,14 +134,14 @@ class HTTP11Connection(ConnectionInterface): + event = h11.Data(data=chunk) + self._send_event(event, timeout=timeout) + +- event = h11.EndOfMessage() +- self._send_event(event, timeout=timeout) ++ self._send_event(h11.EndOfMessage(), timeout=timeout) + + def _send_event( +- self, event: H11Event, timeout: Optional[float] = None ++ self, event: h11.Event, timeout: Optional[float] = None + ) -> None: + bytes_to_send = self._h11_state.send(event) +- self._network_stream.write(bytes_to_send, timeout=timeout) ++ if bytes_to_send is not None: ++ self._network_stream.write(bytes_to_send, timeout=timeout) + + # Receiving the response... + +@@ -168,7 +175,9 @@ class HTTP11Connection(ConnectionInterface): + elif isinstance(event, (h11.EndOfMessage, h11.PAUSED)): + break + +- def _receive_event(self, timeout: Optional[float] = None) -> H11Event: ++ def _receive_event( ++ self, timeout: Optional[float] = None ++ ) -> Union[h11.Event, Type[h11.PAUSED]]: + while True: + with map_exceptions({h11.RemoteProtocolError: RemoteProtocolError}): + event = self._h11_state.next_event() +@@ -192,7 +201,8 @@ class HTTP11Connection(ConnectionInterface): + + self._h11_state.receive_data(data) + else: +- return event ++ # mypy fails to narrow the type in the above if statement above ++ return cast(Union[h11.Event, Type[h11.PAUSED]], event) + + def _response_closed(self) -> None: + with self._state_lock: diff --git a/www/py-httpcore/files/patch-setup.py b/www/py-httpcore/files/patch-setup.py index d70a1b2e8e61..d804a6bc020a 100644 --- a/www/py-httpcore/files/patch-setup.py +++ b/www/py-httpcore/files/patch-setup.py @@ -1,11 +1,13 @@ ---- setup.py.orig 2022-01-18 11:44:56 UTC +Obtained from: https://github.com/encode/httpcore/commit/4cf288e0007cb73561b9020af9228f076ba2a94e + +--- setup.py.orig 2022-05-17 12:45:06 UTC +++ setup.py @@ -54,7 +54,7 @@ setup( include_package_data=True, zip_safe=False, install_requires=[ - "h11>=0.11,<0.13", -+ "h11>=0.11,<0.14", ++ "h11>=0.13,<0.15", "sniffio==1.*", "anyio==3.*", "certifi",