From ab0f76ecffac5b848b6cb542aa2b69d9ba0a5b144c122bbbf14d9541ef4a727e Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 18 Jun 2021 11:18:04 +0000 Subject: [PATCH 1/2] Accepting request 900750 from home:alarrosa:branches:devel:languages:python - Update to 0.18.2 * Added - Support for Python 3.10. (Pull #1687) - Expose httpx.USE_CLIENT_DEFAULT, used as the default to auth and timeout parameters in request methods. - Support HTTP/2 "prior knowledge", using httpx.Client(http1=False, http2=True). * Fixed - Clean up some cases where warnings were being issued. - Prefer Content-Length over Transfer-Encoding: chunked for content= cases. - Update to 0.18.1 * Changed - Update brotli support to use the brotlicffi package - Ensure that Request(..., stream=...) does not auto-generate any headers on the request instance. * Fixed - Pass through timeout=... in top-level httpx.stream() function. - Map httpcore transport close exceptions to httpx exceptions. - Add patch (submitted to upstream at gh#encode/httpx#1669) to add a pytest marker so we can disable the tests that use the network in %check: * 0001-Add-a-network-pytest-mark-for-tests-that-use-the-network.patch OBS-URL: https://build.opensuse.org/request/show/900750 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpx?expand=0&rev=3 --- ...-mark-for-tests-that-use-the-network.patch | 64 +++++++++++++++++++ httpx-0.18.0.tar.gz | 3 - httpx-0.18.2.tar.gz | 3 + python-httpx.changes | 30 +++++++++ python-httpx.spec | 12 ++-- 5 files changed, 104 insertions(+), 8 deletions(-) create mode 100644 0001-Add-a-network-pytest-mark-for-tests-that-use-the-network.patch delete mode 100644 httpx-0.18.0.tar.gz create mode 100644 httpx-0.18.2.tar.gz diff --git a/0001-Add-a-network-pytest-mark-for-tests-that-use-the-network.patch b/0001-Add-a-network-pytest-mark-for-tests-that-use-the-network.patch new file mode 100644 index 0000000..0ccd28c --- /dev/null +++ b/0001-Add-a-network-pytest-mark-for-tests-that-use-the-network.patch @@ -0,0 +1,64 @@ +From 55b8ee87b0e57f3dda924e3d01ee8eaa39c4aa81 Mon Sep 17 00:00:00 2001 +From: Antonio Larrosa +Date: Mon, 7 Jun 2021 18:32:29 +0200 +Subject: [PATCH] Add a network pytest mark for tests that use the network + +Sometimes it's useful to have the tests that use the network +marked so they can be skipped easily when we know the network +is not available. + +This is useful for example on SUSE and openSUSE's build servers. +When building the httpx packages (actually, any package in the +distribution) the network is disabled so we can assure +reproducible builds (among other benefits). With this mark, it's +easier to skip tests that can not succeed. +--- + setup.cfg | 1 + + tests/client/test_proxies.py | 2 ++ + tests/test_timeouts.py | 1 + + 3 files changed, 4 insertions(+) + +diff --git a/setup.cfg b/setup.cfg +index c860d819c..eb5451d96 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -18,6 +18,7 @@ combine_as_imports = True + default:::uvicorn + 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 ++ network: marks tests which require network connection + + [coverage:run] + omit = venv/*, httpx/_compat.py +diff --git a/tests/client/test_proxies.py b/tests/client/test_proxies.py +index 6ea4cbe40..2817d202b 100644 +--- a/tests/client/test_proxies.py ++++ b/tests/client/test_proxies.py +@@ -122,6 +122,7 @@ def test_transport_for_request(url, proxies, expected): + + + @pytest.mark.asyncio ++@pytest.mark.network + async def test_async_proxy_close(): + try: + client = httpx.AsyncClient(proxies={"https://": PROXY_URL}) +@@ -130,6 +131,7 @@ async def test_async_proxy_close(): + await client.aclose() + + ++@pytest.mark.network + def test_sync_proxy_close(): + try: + client = httpx.Client(proxies={"https://": PROXY_URL}) +diff --git a/tests/test_timeouts.py b/tests/test_timeouts.py +index 46a8bee8f..c7a665c3b 100644 +--- a/tests/test_timeouts.py ++++ b/tests/test_timeouts.py +@@ -23,6 +23,7 @@ async def test_write_timeout(server): + + + @pytest.mark.usefixtures("async_environment") ++@pytest.mark.network + async def test_connect_timeout(server): + timeout = httpx.Timeout(None, connect=1e-6) + diff --git a/httpx-0.18.0.tar.gz b/httpx-0.18.0.tar.gz deleted file mode 100644 index 4373487..0000000 --- a/httpx-0.18.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d8d751e23dd4174d4d4bebc4904e8407f26ff34b931630658a3a708e37dcbbf1 -size 1663878 diff --git a/httpx-0.18.2.tar.gz b/httpx-0.18.2.tar.gz new file mode 100644 index 0000000..2ed9aba --- /dev/null +++ b/httpx-0.18.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d56098724fbff3840a53a9e0e522867e05436cc8211aaed0b87f1120aa5bdc +size 1666756 diff --git a/python-httpx.changes b/python-httpx.changes index a5eda3d..5336ae6 100644 --- a/python-httpx.changes +++ b/python-httpx.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Fri Jun 18 07:56:56 UTC 2021 - Antonio Larrosa + +- Update to 0.18.2 + * Added + - Support for Python 3.10. (Pull #1687) + - Expose httpx.USE_CLIENT_DEFAULT, used as the default to auth + and timeout parameters in request methods. + - Support HTTP/2 "prior knowledge", using + httpx.Client(http1=False, http2=True). + * Fixed + - Clean up some cases where warnings were being issued. + - Prefer Content-Length over Transfer-Encoding: chunked for + content= cases. + +- Update to 0.18.1 + * Changed + - Update brotli support to use the brotlicffi package + - Ensure that Request(..., stream=...) does not auto-generate + any headers on the request instance. + * Fixed + - Pass through timeout=... in top-level httpx.stream() + function. + - Map httpcore transport close exceptions to httpx exceptions. + +- Add patch (submitted to upstream at gh#encode/httpx#1669) to add + a pytest marker so we can disable the tests that use the network + in %check: + * 0001-Add-a-network-pytest-mark-for-tests-that-use-the-network.patch + ------------------------------------------------------------------- Thu Jun 3 15:15:51 UTC 2021 - Antonio Larrosa diff --git a/python-httpx.spec b/python-httpx.spec index f09f204..a63cbce 100644 --- a/python-httpx.spec +++ b/python-httpx.spec @@ -20,17 +20,19 @@ %define skip_python2 1 %define skip_python36 1 Name: python-httpx -Version: 0.18.0 +Version: 0.18.2 Release: 0 Summary: Python HTTP client with async support License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/encode/httpx Source: https://github.com/encode/httpx/archive/%{version}.tar.gz#/httpx-%{version}.tar.gz +# PATCH-FIX-UPSTREAM alarrosa@suse.com (gh#encode/httpx#1669) +Patch0: 0001-Add-a-network-pytest-mark-for-tests-that-use-the-network.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-Brotli >= 0.7.0 +Requires: python-brotlicffi Requires: python-certifi Requires: python-chardet >= 3.0 Requires: python-h11 >= 0.8.0 @@ -42,7 +44,7 @@ Requires: python-rfc3986 >= 1.3 Requires: python-sniffio BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module Brotli >= 0.7.0} +BuildRequires: %{python_module brotlicffi} BuildRequires: %{python_module async_generator} BuildRequires: %{python_module certifi} BuildRequires: %{python_module chardet >= 3.0} @@ -68,6 +70,7 @@ Python HTTP client with async support. %prep %setup -q -n httpx-%{version} +%patch0 -p1 rm setup.cfg %build @@ -78,8 +81,7 @@ rm setup.cfg %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# test_start_tls_on_*_socket_stream and test_connect_timeout require network -%pytest -k 'not (test_start_tls_on_tcp_socket_stream or test_start_tls_on_uds_socket_stream or test_connect_timeout or test_async_proxy_close or test_sync_proxy_close)' +%pytest -k 'not network' %files %{python_files} %doc CHANGELOG.md README.md From 4e5ef9722c9d329fd2a86f017b504b0ebb6f04219086ed15abb4961e5783a3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 12 Jul 2021 07:20:27 +0000 Subject: [PATCH 2/2] Accepting request 905774 from home:mcalabkova:branches:devel:languages:python add missing dependency & spec-cleaner OBS-URL: https://build.opensuse.org/request/show/905774 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpx?expand=0&rev=5 --- python-httpx.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-httpx.spec b/python-httpx.spec index a63cbce..db125e8 100644 --- a/python-httpx.spec +++ b/python-httpx.spec @@ -44,8 +44,9 @@ Requires: python-rfc3986 >= 1.3 Requires: python-sniffio BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module brotlicffi} +BuildRequires: %{python_module anyio} BuildRequires: %{python_module async_generator} +BuildRequires: %{python_module brotlicffi} BuildRequires: %{python_module certifi} BuildRequires: %{python_module chardet >= 3.0} BuildRequires: %{python_module h11 >= 0.8.0}