From 27523aaea42b84743868b29d46e2b90de5ab84e139dbaaf8b363a4b309501508 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 29 Oct 2024 17:06:08 +0000 Subject: [PATCH] - Update to 1.0.6 * Relax `trio` dependency pinning. * Handle `trio` raising `NotImplementedError` on unsupported platforms. * Handle mapping `ssl.SSLError` to `httpcore.ConnectError`. - Update Requires from pyproject.toml OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpcore?expand=0&rev=35 --- .gitattributes | 23 ++ .gitignore | 1 + _multibuild | 3 + httpcore-1.0.5.tar.gz | 3 + httpcore-1.0.6.tar.gz | 3 + httpcore-allow-deprecationwarnings-test.patch | 21 ++ python-httpcore.changes | 298 ++++++++++++++++++ python-httpcore.spec | 100 ++++++ 8 files changed, 452 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 httpcore-1.0.5.tar.gz create mode 100644 httpcore-1.0.6.tar.gz create mode 100644 httpcore-allow-deprecationwarnings-test.patch create mode 100644 python-httpcore.changes create mode 100644 python-httpcore.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/httpcore-1.0.5.tar.gz b/httpcore-1.0.5.tar.gz new file mode 100644 index 0000000..32b9e8e --- /dev/null +++ b/httpcore-1.0.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5058e39e0ee755aa894f8faacb052f3174df3ba5ca8b5102a327fec3bfa39e09 +size 97696 diff --git a/httpcore-1.0.6.tar.gz b/httpcore-1.0.6.tar.gz new file mode 100644 index 0000000..864120d --- /dev/null +++ b/httpcore-1.0.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c17be5ee13c8be65bbcba4f5e7b512bd69c3382d64552841988799b5261b6cfe +size 99863 diff --git a/httpcore-allow-deprecationwarnings-test.patch b/httpcore-allow-deprecationwarnings-test.patch new file mode 100644 index 0000000..ada1e3a --- /dev/null +++ b/httpcore-allow-deprecationwarnings-test.patch @@ -0,0 +1,21 @@ +--- + pyproject.toml | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -86,7 +86,13 @@ ignore_missing_imports = true + [tool.pytest.ini_options] + addopts = ["-rxXs", "--strict-config", "--strict-markers"] + markers = ["copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accodomate e.g. our test setup"] +-filterwarnings = ["error"] ++filterwarnings = [ ++ "error", ++ "ignore:trio.MultiError is deprecated", ++ "ignore:unclosed <(socket.socket|ssl.SSLSocket) .*:ResourceWarning", ++ "ignore:ssl.wrap_socket() is deprecated, use SSLContext.wrap_socket():DeprecationWarning", ++ "ignore:ssl.PROTOCOL_TLS is deprecated:DeprecationWarning" ++] + + [tool.coverage.run] + omit = [ diff --git a/python-httpcore.changes b/python-httpcore.changes new file mode 100644 index 0000000..85ff6ab --- /dev/null +++ b/python-httpcore.changes @@ -0,0 +1,298 @@ +------------------------------------------------------------------- +Tue Oct 29 09:23:07 UTC 2024 - John Paul Adrian Glaubitz + +- Update to 1.0.6 + * Relax `trio` dependency pinning. + * Handle `trio` raising `NotImplementedError` on unsupported platforms. + * Handle mapping `ssl.SSLError` to `httpcore.ConnectError`. +- Update Requires from pyproject.toml + +------------------------------------------------------------------- +Wed Apr 3 07:04:47 UTC 2024 - Dirk Müller + +- update to 1.0.5: + * Handle `EndOfStream` exception for anyio backend. + * Allow trio `0.25.*` series in package dependancies. + +------------------------------------------------------------------- +Tue Mar 19 07:11:39 UTC 2024 - Dirk Müller + +- update to 1.0.4: + * Add `target` request extension. + * Fix support for connection `Upgrade` and `CONNECT` when some + data in the stream has been read. + * Fix support for async cancellations. + * Fix trace extension when used with socks proxy. + * Fix SSL context for connections using the "wss" scheme + +------------------------------------------------------------------- +Thu Dec 7 22:46:51 UTC 2023 - Dirk Müller + +- update to 1.0.2: + * Fix `float("inf")` timeouts in `Event.wait` function. (#846) + * Fix pool timeout to account for the total time spent + retrying. (#823) + * Raise a neater RuntimeError when the correct async deps are + not installed. (#826) + * Add support for synchronous TLS-in-TLS streams. (#840) + * From version 1.0 our async support is now optional, as the + package has minimal dependencies by default. + * For async support use either `pip install + 'httpcore[asyncio]'` or `pip install 'httpcore[trio]'`. + * The project versioning policy is now explicitly governed by + SEMVER. See https://semver.org/. + * Async support becomes fully optional. (#809) + * Add support for Python 3.12. (#807) + +------------------------------------------------------------------- +Wed Oct 25 11:30:12 UTC 2023 - Matej Cepl + +- Update to 0.18.0: + - Add support for HTTPS proxies. + - Handle sni_hostname extension with SOCKS proxy. + - Change the type of Extensions from Mapping[Str, Any] to + MutableMapping[Str, Any]. + - Handle HTTP/1.1 half-closed connections gracefully. + - Drop Python 3.7 support. +- Update httpcore-allow-deprecationwarnings-test.patch +- Skip failing tests test_ssl_request and test_extra_info + (gh#encode/httpcore!832) + +------------------------------------------------------------------- +Sun Sep 10 11:05:24 UTC 2023 - Torsten Gruner + +- update to 0.17.3 + * Support async cancellations, ensuring that the connection pool + is left in a clean state when cancellations occur. (#726) + * The networking backend interface has been added to the public API. + Some classes which were previously private implementation detail + are now part of the top-level public API. (#699) + * Graceful handling of HTTP/2 GoAway frames, with requests being + transparently retried on a new connection. (#730) + * Add exceptions when a synchronous trace callback is passed to an + asynchronous request or an asynchronous trace callback is passed + to a synchronous request. (#717) +- version 0.17.2 + * Add socket_options argument to ConnectionPool and HTTProxy classes. (#668) + * Improve logging with per-module logger names. (#690) + * Add sni_hostname request extension. (#696) + * Resolve race condition during import of anyio package. (#692) + * Enable TCP_NODELAY for all synchronous sockets. (#651) +- version 0.17.1 + * If 'retries' is set, then allow retries if an SSL handshake + error occurs. (#669) + * Improve correctness of tracebacks on network exceptions, by + raising properly chained exceptions. (#678) + * Prevent connection-hanging behaviour when HTTP/2 connections + are closed by a server-sent 'GoAway' frame". (#679) + * Fix edge-case exception when removing requests from the connection pool. (#680) + * Fix pool timeout edge-case. (#688) + +------------------------------------------------------------------- +Wed May 3 08:46:32 UTC 2023 - Dirk Müller + +- update to 0.17.0: + * Add DEBUG level logging. (#648) + * Respect HTTP/2 max concurrent streams when settings updates + are sent by server. (#652) + * Increase the allowable HTTP header size to 100kB. (#647) + * Add `retries` option to SOCKS proxy classes. (#643) + +------------------------------------------------------------------- +Fri Apr 21 12:26:21 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:41:53 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Fri Dec 23 17:57:37 UTC 2022 - Ben Greiner + +- Update to 0.16.3 + * Allow ws and wss schemes. Allows us to properly support + websocket upgrade connections. (#625) + * Forwarding HTTP proxies use a connection-per-remote-host. + Required by some proxy implementations. (#637) + * Don't raise RuntimeError when closing a connection pool with + active connections. Removes some error cases when cancellations + are used. (#631) + * Lazy import anyio, so that it's no longer a hard dependancy, + and isn't imported if unused. (#639) +- Add httpcore-allow-deprecationwarnings-test.patch + gh#encode/httpcore#511, gh#agronholm/anyio#470 + +------------------------------------------------------------------- +Mon Dec 19 10:11:16 UTC 2022 - Dirk Müller + +- update to 0.16.2: + * Revert 'Fix async cancellation behaviour', which introduced race conditions + * Raise RuntimeError if attempting to us UNIX domain sockets on Windows + * Fix HTTP/1.1 interim informational responses, such as "100 Continue" + * Support HTTP/1.1 informational responses. + * Fix async cancellation behaviour. + * Support h11 0.14 + +------------------------------------------------------------------- +Wed Nov 23 14:26:53 UTC 2022 - Matej Cepl + +- Skip failing test_request_with_content test + (gh#encode/httpcore#622). + +------------------------------------------------------------------- +Tue Jul 19 15:31:11 UTC 2022 - Ben Greiner + +- Update to 0.15.0 + * Drop Python 3.6 support (#535) + * Ensure HTTP proxy CONNECT requests include timeout + configuration. (#506) + * Switch to explicit typing.Optional for type hints (#513) + * For trio map OSError exceptions to ConnectError (#543) +- Fix forgotten test package dep drops -- gh#encode/httpcore#473 + +------------------------------------------------------------------- +Mon Feb 21 10:54:40 UTC 2022 - Michael Ströder + +- update to 0.14.7: + * Requests which raise a PoolTimeout need to be removed from the pool queue. + * Fix AttributeError that happened when Socks5Connection were terminated. + * Fix SOCKS support for `http://` URLs. + * Resolve race condition around exceptions during streaming a response. + +------------------------------------------------------------------- +Fri Feb 11 20:38:24 UTC 2022 - Michael Ströder + +- Only recommend and not require the installation of python-h2 because it is + seriously broken and prevents any other Python software to run correctly with -bb. + (See also: https://github.com/python-hyper/h2/issues/1236) + This also matches upstream's setup.py which lists h2 as optional + dependency in extra_requires. + +------------------------------------------------------------------- +Tue Feb 1 07:47:22 UTC 2022 - Steve Kowalik + +- Update to 0.14.5: + * SOCKS proxy support. (#478) + * Add proxy_auth argument to HTTPProxy (#481) + * Improve error message on 'RemoteProtocolError' exception when server + disconnects without sending a response (#479) + * Support HTTP/2 on HTTPS tunnelling proxies. (#468) + * Fix proxy headers missing on HTTP forwarding. (#456) + * Only instantiate SSL context if required. (#457) + * More robust HTTP/2 handling. (#253, #439, #440, #441) + * Fix race condition when removing closed connections from the pool (#437) + * Failed connections no longer remain in the pool. (Pull #433) + * max_connections becomes optional. (Pull #429) + * certifi is now included in the install dependancies. (Pull #428) + * h2 is now strictly optional. (Pull #428) + * Log the point at which the connection is established, and the IP/port + on which it is made. + * Determine if the outgoing request should log as HTTP/1.1 or HTTP/2, + rather than having to assume it's HTTP/2 if the --http2 flag was passed. + * Log SSL version info / certificate info. + * Fix broken error messaging when URL scheme is missing, or a non HTTP(S) + scheme is used. (Pull #403) +- Inject multibuild to stop a build loop + +------------------------------------------------------------------- +Tue Jul 13 13:42:56 UTC 2021 - Matej Cepl + +- anyio is actually required (at least for some tests in other + packages). + +------------------------------------------------------------------- +Thu Jul 8 08:16:46 UTC 2021 - Antonio Larrosa + +- Update to v0.13.6 + * Fixed + - Close sockets when read or write timeouts occur. (Pull #365) + +- Update to v0.13.5 + * Fixed + - Resolved niggles with AnyIO EOF behaviours. (Pull #358, #362) + +- Update to v0.13.4 + * Added + - Improved error messaging when URL scheme is missing, or + a non HTTP(S) scheme is used. (Pull #354) + * Fixed + - Switched to anyio as the default backend implementation when + running with asyncio. Resolves some awkward TLS timeout + issues. + +------------------------------------------------------------------- +Thu Jun 3 09:10:31 UTC 2021 - Antonio Larrosa + +- Update to v0.13.3 + * Added + - Support HTTP/2 prior knowledge, using + httpcore.SyncConnectionPool(http1=False). (Pull #333) + * Fixed + - Handle cases where environment does not provide select.poll + support. (Pull #331) + +- Update to v0.13.2 + * Added + - Improve error message for specific case of + RemoteProtocolError where server disconnects without + sending a response. (Pull #313) + +- Update to v0.13.1 + * Fixed + - More resiliant testing for closed connections. + (Pull #311) + - Don't raise exceptions on ungraceful connection closes. + (Pull #310) + +- Update to v0.13.0 + * The 0.13 release updates the core API in order to match the + HTTPX Transport API, introduced in HTTPX 0.18 onwards. + * Changed + - The .request() method is now handle_request(). (Pull #296) + - The .arequest() method is now .handle_async_request(). + (Pull #296) + - The headers argument is no longer optional. (Pull #296) + - The stream argument is no longer optional. (Pull #296) + - The ext argument is now named extensions, and is no longer + optional. (Pull #296) + - The "reason" extension keyword is now named "reason_phrase". + (Pull #296) + - The "reason_phrase" and "http_version" extensions now use + byte strings for their values. (Pull #296) + - The httpcore.PlainByteStream() class becomes + httpcore.ByteStream(). (Pull #296) + * Added + - Streams now support a .read() interface. (Pull #296) + * Fixed + - Task cancelation no longer leaks connections from the + connection pool. (Pull #305) + +- Update to v0.12.3 + * Fixed + - Abort SSL connections on close rather than waiting for remote + EOF when using asyncio. (Pull #167) + - Fix exception raised in case of connect timeouts when using + the anyio backend. (Pull #236) + - Fix Host header precedence for :authority in HTTP/2. + (Pull #241, #243) + - Handle extra edge case when detecting for socket readability + when using asyncio. (Pull #242, #244) + - Fix asyncio SSL warning when using proxy tunneling. + (Pull #249) + +------------------------------------------------------------------- +Sat May 1 20:32:11 UTC 2021 - Matej Cepl + +- Don't build on python36, because of missing dependencies. + +------------------------------------------------------------------- +Sat Nov 21 11:09:07 UTC 2020 - John Vandenberg + +- Update to v0.12.2 + +------------------------------------------------------------------- +Wed Jan 8 12:28:26 AM UTC 2020 - John Vandenberg + +- Initial spec for v0.4.0 diff --git a/python-httpcore.spec b/python-httpcore.spec new file mode 100644 index 0000000..6142631 --- /dev/null +++ b/python-httpcore.spec @@ -0,0 +1,100 @@ +# +# spec file for package python-httpcore +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif + +%{?sle15_python_module_pythons} +Name: python-httpcore%{psuffix} +Version: 1.0.6 +Release: 0 +Summary: Minimal low-level Python HTTP client +License: BSD-3-Clause +URL: https://github.com/encode/httpcore +Source: https://github.com/encode/httpcore/archive/%{version}.tar.gz#/httpcore-%{version}.tar.gz +# PATCH-FIX-UPSTREAM httpcore-allow-deprecationwarnings-test.patch gh#encode/httpcore#511, gh#agronholm/anyio#470 +Patch1: httpcore-allow-deprecationwarnings-test.patch +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module hatch-fancy-pypi-readme} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-certifi +Requires: (python-anyio >= 3 with python-anyio < 5) +Requires: (python-h11 >= 0.13.0 with python-h11 < 0.15) +Requires: (python-sniffio >= 1.0 with python-sniffio < 2) +Recommends: python-h2 >= 3.0 +Recommends: python-socksio >= 1.0 +BuildArch: noarch +# SECTION test requirements +%if %{with test} +BuildRequires: %{python_module Werkzeug} +BuildRequires: %{python_module h2 >= 3.0} +BuildRequires: %{python_module httpcore = %{version}} +BuildRequires: %{python_module pytest >= 7.0.1} +BuildRequires: %{python_module pytest-asyncio >= 0.16.0} +BuildRequires: %{python_module pytest-httpbin} +BuildRequires: %{python_module pytest-trio >= 0.7.0} +BuildRequires: %{python_module trio >= 0.22.0} +%endif +# /SECTION +%python_subpackages + +%description +Python minimal low-level HTTP client. + +%prep +%autosetup -p1 -n httpcore-%{version} + +%if !%{with test} +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%if %{with test} +%check +# we don't ship socksio +donttest="socks5" +# gh#encode/httpcore#622 +donttest+=" or test_request_with_content" +# gh#encode/httpcore!832 +donttest+=" or test_ssl_request or test_extra_info" +%pytest -rsfE --asyncio-mode=strict -p no:unraisableexception -k "not ($donttest)" +%endif + +%if !%{with test} +%files %{python_files} +%doc README.md +%license LICENSE.md +%{python_sitelib}/httpcore +%{python_sitelib}/httpcore-%{version}*-info +%endif + +%changelog