From 5dd099fde6015b0d27b68caa239a4879079c429c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 30 Jan 2024 15:43:19 -0500 Subject: [PATCH] Update to 2.2.0 --- .gitignore | 2 ++ python-urllib3.spec | 59 ++++++++++++++++++++++++++++++++++++--------- sources | 3 ++- 3 files changed, 52 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 74e9ffd..7eb9f60 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ /urllib3-1.26.19.tar.gz /urllib3-2.0.7.tar.gz /urllib3-2.1.0.tar.gz +/urllib3-2.2.0.tar.gz +/hypercorn-d1719f8c1570cbd8e6a3719ffdb14a4d72880abb.tar.gz diff --git a/python-urllib3.spec b/python-urllib3.spec index 8e75be0..04c5259 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -9,14 +9,30 @@ %endif Name: python-urllib3 -Version: 2.1.0 +Version: 2.2.0 Release: %autorelease Summary: HTTP library with thread-safe connection pooling, file post, and more # SPDX License: MIT URL: https://github.com/urllib3/urllib3 -Source: %{url}/archive/%{version}/urllib3-%{version}.tar.gz +Source0: %{url}/archive/%{version}/urllib3-%{version}.tar.gz +# A special forked copy of Hypercorn is required for testing. We asked about +# the possiblility of using a released version in the future in: +# Path toward testing with a released version of hypercorn? +# https://github.com/urllib3/urllib3/3334 +# Upstream would like to get the necessary changes merged into Hypercorn, but +# explained clearly why the forked copy is needed for now. +# +# Note that dev-requirements.txt references the urllib3-changes branch of +# https://github.com/urllib3/hypercorn/, and we should use the latest commit +# from that branch, but we package using a commit hash for reproducibility. +# +# We do not need to treat this as a bundled dependency because it is not +# installed in the buildroot or otherwise included in any of the binary RPMs. +%global hypercorn_url https://github.com/urllib3/hypercorn +%global hypercorn_commit d1719f8c1570cbd8e6a3719ffdb14a4d72880abb +Source1: %{hypercorn_url}/archive/%{hypercorn_commit}/hypercorn-%{hypercorn_commit}.tar.gz BuildArch: noarch @@ -26,9 +42,9 @@ BuildRequires: python3-devel # Test dependencies are listed only in dev-requirements.txt. Because there are # linters and coverage tools mixed in, and exact versions are pinned, we resort # to manual listing. -# coverage==7.3.2: omitted linter/coverage tool -# tornado==6.3.3 -BuildRequires: %{py3_dist tornado} +# h2==4.1.0: also in the h2 extra +BuildRequires: %{py3_dist h2} +# coverage==7.4.1: omitted linter/coverage tool # PySocks==1.7.1 BuildRequires: %{py3_dist PySocks} # pytest==7.4.2 @@ -37,14 +53,29 @@ BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist pytest-timeout} # pyOpenSSL==23.2.0 BuildRequires: %{py3_dist pyOpenSSL} +# idna==3.4 +BuildRequires: %{py3_dist idna} # trustme==1.1.0 BuildRequires: %{py3_dist trustme} -# cryptography==41.0.4 +# cryptography==41.0.6 BuildRequires: %{py3_dist cryptography} # backports.zoneinfo==0.2.1;python_version<"3.9" # towncrier==23.6.0: used for generating a changelog # pytest-memray==1.5.0;python_version>="3.8" and implementation_name=="cpython": # not packaged, unwanted profiler +# trio==0.23.1 +BuildRequires: %{py3_dist trio} +# Quart==0.19.4 +BuildRequires: %{py3_dist Quart} +# quart-trio==0.11.1 +BuildRequires: %{py3_dist quart-trio} +# # https://github.com/pgjones/hypercorn/issues/62 +# # https://github.com/pgjones/hypercorn/issues/168 +# # https://github.com/pgjones/hypercorn/issues/169 +# hypercorn @ git+https://github.com/urllib3/hypercorn@urllib3-changes +# hypercorn is packaged, but we need the forked/bundled version +# httpx==0.25.2 +BuildRequires: %{py3_dist httpx} %endif %global _description %{expand: @@ -84,12 +115,14 @@ Recommends: python3-urllib3+socks %if %{with extras} -%pyproject_extras_subpkg -n python3-urllib3 brotli zstd socks +%pyproject_extras_subpkg -n python3-urllib3 brotli zstd socks h2 %endif %prep %autosetup -n urllib3-%{version} +%setup -q -n urllib3-%{version} -T -D -b 1 + # Make sure that the RECENT_DATE value doesn't get too far behind what the current date is. # RECENT_DATE must not be older that 2 years from the build time, or else test_recent_date # (from test/test_connection.py) would fail. However, it shouldn't be to close to the build time either, @@ -112,7 +145,7 @@ sed -i "s/^RECENT_DATE = datetime.date(.*)/RECENT_DATE = datetime.date($recent_d %generate_buildrequires # Generate BR’s from packaged extras even when tests are disabled, to ensure # the extras metapackages are installable if the build succeeds. -%pyproject_buildrequires %{?with_extras:-x brotli,zstd,socks} +%pyproject_buildrequires %{?with_extras:-x brotli,zstd,socks,h2} %build @@ -127,10 +160,13 @@ sed -i "s/^RECENT_DATE = datetime.date(.*)/RECENT_DATE = datetime.date($recent_d %check # urllib3.contrib.socks requires urllib3[socks] +# +# urllib3.contrib.emscripten is “special” (import js will fail) # urllib3.contrib.ntlmpool is deprecated and requires ntlm # urllib3.contrib.securetransport is macOS only # urllib3.contrib.pyopenssl requires pyOpenSSL %{pyproject_check_import %{!?with_extras:-e urllib3.contrib.socks} + -e urllib3.contrib.emscripten* -e urllib3.contrib.ntlmpool -e urllib3.contrib.securetransport -e urllib3.contrib.pyopenssl} @@ -138,11 +174,11 @@ sed -i "s/^RECENT_DATE = datetime.date(.*)/RECENT_DATE = datetime.date($recent_d # Increase the “long timeout” for slower environments; as of this writing, it # is increased from 0.1 to 0.5 second. export CI=1 +# Interpose the special forked copy of Hypercorn. +hypercorndir="${PWD}/../hypercorn-%{hypercorn_commit}/src" +export PYTHONPATH="${hypercorndir}:%{buildroot}%{python3_sitelib}" %if %{with tests} -# These tests *may* time out; https://github.com/urllib3/urllib3/pull/3206 -# purports to fix some of them, but there is still a lot of flakiness here. -ignore="${ignore-} --ignore=test/with_dummyserver/test_socketlevel.py" # This test still times out sometimes, especially on certain architectures, # even when we export the CI environment variable to increase timeouts. k="${k-}${k+ and }not (TestHTTPProxyManager and test_tunneling_proxy_request_timeout[https-https])" @@ -168,6 +204,7 @@ k="${k-}${k+ and }not (TestSocketSSL and test_requesting_large_resources_via_ssl k="${k-}${k+ and }not (TestSocketSSL and test_ssl_failure_midway_through_conn)" %pytest -v -rs ${ignore-} -k "${k-}" +%pytest -v -rs ${ignore-} -k "${k-}" --integration %endif diff --git a/sources b/sources index 8326d49..06db068 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (urllib3-2.1.0.tar.gz) = 3568803cbfa8d6cb57cb20e91c1bf2eb84e6d40e81c77adf93934220f3c61c371a1107448fa50ab909d942787497e8a9c77536016c93a13dae7e0c9e7563d3a9 +SHA512 (urllib3-2.2.0.tar.gz) = 3914442c92980c9b803e7726228b147e326f71bf4ae7507b64474de6cb6df86e3e90026fd2f41e4f83e8bc6735b0f816cfc9945839a7cc5d0a86d31a5a8d6438 +SHA512 (hypercorn-d1719f8c1570cbd8e6a3719ffdb14a4d72880abb.tar.gz) = 62d6787d88a2e716f0ac04fc49f6cdc586e473a660ee754ff66961922ae78bcc75d1f78b091e78557dd60f006e8e480114738c7b4ff71beac804e4fc9603240b