From 3d208d1e184aaecc41b0fa4bd2e06358c466287d Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 12 Aug 2025 10:41:32 +0000 Subject: [PATCH] import OL python-awscrt-0.27.2-1.el10_0 --- .gitignore | 2 +- .python-awscrt.metadata | 1 + .../skip-SHA1-in-test_crypto.patch | 24 +++++- SOURCES/skip-tests-requiring-network.patch | 20 +++++ .../python-awscrt.spec | 83 ++++++++++--------- skip-test-requiring-network.patch | 12 --- sources | 1 - 7 files changed, 86 insertions(+), 57 deletions(-) create mode 100644 .python-awscrt.metadata rename skip-testing-sha1.patch => SOURCES/skip-SHA1-in-test_crypto.patch (61%) create mode 100644 SOURCES/skip-tests-requiring-network.patch rename python-awscrt.spec => SPECS/python-awscrt.spec (87%) delete mode 100644 skip-test-requiring-network.patch delete mode 100644 sources diff --git a/.gitignore b/.gitignore index 29a4aa1..ace367d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -awscrt-0.23.8.tar.gz +SOURCES/awscrt-0.27.2.tar.gz diff --git a/.python-awscrt.metadata b/.python-awscrt.metadata new file mode 100644 index 0000000..d27518a --- /dev/null +++ b/.python-awscrt.metadata @@ -0,0 +1 @@ +9951436161fdbf91db142b85d6aa208614dc2b0b SOURCES/awscrt-0.27.2.tar.gz diff --git a/skip-testing-sha1.patch b/SOURCES/skip-SHA1-in-test_crypto.patch similarity index 61% rename from skip-testing-sha1.patch rename to SOURCES/skip-SHA1-in-test_crypto.patch index 5a70c1c..c5030c7 100644 --- a/skip-testing-sha1.patch +++ b/SOURCES/skip-SHA1-in-test_crypto.patch @@ -1,8 +1,8 @@ diff --git a/test/test_crypto.py b/test/test_crypto.py -index 008b164..d0acfdd 100644 +index 628900f..7f2296d 100644 --- a/test/test_crypto.py +++ b/test/test_crypto.py -@@ -192,15 +192,11 @@ class TestCredentials(NativeResourceTest): +@@ -236,15 +236,11 @@ class TestCredentials(NativeResourceTest): def test_rsa_signing_roundtrip(self): param_list = [RSASignatureAlgorithm.PKCS1_5_SHA256, @@ -20,7 +20,25 @@ index 008b164..d0acfdd 100644 h.update(b'totally original test string') digest = h.digest() -@@ -213,15 +209,11 @@ class TestCredentials(NativeResourceTest): +@@ -257,15 +253,11 @@ class TestCredentials(NativeResourceTest): + + def test_rsa_signing_roundtrip_pkcs8(self): + param_list = [RSASignatureAlgorithm.PKCS1_5_SHA256, +- RSASignatureAlgorithm.PSS_SHA256, +- RSASignatureAlgorithm.PKCS1_5_SHA1] ++ RSASignatureAlgorithm.PSS_SHA256] + + for p in param_list: + with self.subTest(msg="RSA Signing Roundtrip using algo p", p=p): +- if (p == RSASignatureAlgorithm.PKCS1_5_SHA1): +- h = Hash.sha1_new() +- else: +- h = Hash.sha256_new() ++ h = Hash.sha256_new() + h.update(b'totally original test string') + digest = h.digest() + +@@ -275,15 +267,11 @@ class TestCredentials(NativeResourceTest): def test_rsa_signing_roundtrip_der(self): param_list = [RSASignatureAlgorithm.PKCS1_5_SHA256, diff --git a/SOURCES/skip-tests-requiring-network.patch b/SOURCES/skip-tests-requiring-network.patch new file mode 100644 index 0000000..da37539 --- /dev/null +++ b/SOURCES/skip-tests-requiring-network.patch @@ -0,0 +1,20 @@ +diff --git a/test/test_http_client.py b/test/test_http_client.py +index f79f39a..7498a96 100644 +--- a/test/test_http_client.py ++++ b/test/test_http_client.py +@@ -353,6 +353,7 @@ class TestClient(NativeResourceTest): + tls_connection_options=tls_conn_opt) + return connection_future.result(self.timeout) + ++ @unittest.skip("Requires network") + def test_h2_client(self): + url = urlparse("https://d1cz66xoahf9cl.cloudfront.net/http_test_doc.txt") + connection = self._new_h2_client_connection(url) +@@ -375,6 +376,7 @@ class TestClient(NativeResourceTest): + + self.assertEqual(None, connection.close().exception(self.timeout)) + ++ @unittest.skip("Requires network") + def test_h2_manual_write_exception(self): + url = urlparse("https://d1cz66xoahf9cl.cloudfront.net/http_test_doc.txt") + connection = self._new_h2_client_connection(url) diff --git a/python-awscrt.spec b/SPECS/python-awscrt.spec similarity index 87% rename from python-awscrt.spec rename to SPECS/python-awscrt.spec index 98f4f2a..9036c17 100644 --- a/python-awscrt.spec +++ b/SPECS/python-awscrt.spec @@ -10,12 +10,11 @@ %global desc %{expand: Python bindings for the AWS Common Runtime} - - + + Name: python-awscrt -Version: 0.23.8 +Version: 0.27.2 Release: %autorelease - Summary: Python bindings for the AWS Common Runtime # All files are licensed under Apache-2.0, except: # - crt/aws-c-common/include/aws/common/external/cJSON.h is MIT @@ -23,71 +22,75 @@ Summary: Python bindings for the AWS Common Runtime # - crt/s2n/pq-crypto/kyber_r3/KeccakP-brg_endian_avx2.h is BSD-3-Clause License: Apache-2.0 AND MIT AND BSD-3-Clause URL: https://github.com/awslabs/aws-crt-python - + Source0: %{pypi_source awscrt} - -# one test requires internet connection, skip it -Patch0: skip-test-requiring-network.patch -# two tests are checking SHA1 support which is deprecated -Patch1: skip-testing-sha1.patch - + +# two tests require internet connection, skip them +Patch0: skip-tests-requiring-network.patch +# skip SHA1 in test_crypto +Patch1: skip-SHA1-in-test_crypto.patch + BuildRequires: python%{python3_pkgversion}-devel + BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: openssl-devel -BuildRequires: python%{python3_pkgversion}-wheel + BuildRequires: python%{python3_pkgversion}-websockets - -# https://bugzilla.redhat.com/show_bug.cgi?id=2180988 -ExcludeArch: s390x - - + +# s390x: https://bugzilla.redhat.com/show_bug.cgi?id=2180988 +ExcludeArch: %{ix86} s390x + + %description %{desc} - - + + %package -n python%{python3_pkgversion}-awscrt Summary: %{summary} - - + + %description -n python%{python3_pkgversion}-awscrt %{desc} - - + + %prep %autosetup -p1 -n awscrt-%{version} - - + +# relax version requirements +sed -i -e 's/setuptools>=75\.3\.1/setuptools/' -e 's/wheel>=0\.45\.1/wheel/' pyproject.toml + +# stay compatible with websockets<13 +sed -i 's/websockets\.asyncio\.server/websockets.server/' test/test_websocket.py + + %generate_buildrequires %pyproject_buildrequires - - + %build -%ifarch %{ix86} -# disable SSE2 instructions to prevent a crash in aws-c-common thread handling -# probably caused by a compiler bug -export CFLAGS="%{optflags} -mno-sse2" -%endif export AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1 %pyproject_wheel - - + %install %pyproject_install %pyproject_save_files _awscrt awscrt - - + + %check PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}" %{python3} -m unittest - - + + %files -n python%{python3_pkgversion}-awscrt -f %{pyproject_files} %doc README.md - - + + %changelog ## START: Generated by rpmautospec +* Tue Jul 15 2025 Kseniia Nivnia - 0.27.2-1 +- Update to version 0.27.2 and revise existing patches Resolves: + RHEL-103640 + * Mon Feb 24 2025 Kseniia Nivnia - 0.23.8-1 - Update to 0.23.8 and add skip-testing-sha1.patch diff --git a/skip-test-requiring-network.patch b/skip-test-requiring-network.patch deleted file mode 100644 index 1cd7b50..0000000 --- a/skip-test-requiring-network.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/test/test_http_client.py b/test/test_http_client.py -index 5af87b6..dd2631a 100644 ---- a/test/test_http_client.py -+++ b/test/test_http_client.py -@@ -347,6 +347,7 @@ class TestClient(NativeResourceTest): - tls_connection_options=tls_conn_opt) - return connection_future.result(self.timeout) - -+ @unittest.skip("Requires network") - def test_h2_client(self): - url = urlparse("https://d1cz66xoahf9cl.cloudfront.net/http_test_doc.txt") - connection = self._new_h2_client_connection(url) diff --git a/sources b/sources deleted file mode 100644 index dfcc533..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (awscrt-0.23.8.tar.gz) = c8d7b608632a3f09952172c2e3328551e76aa236af39897a392a2c674dda4e3a0fda04094b908a529fd390bf5bf088132eb644b6a4dad4e364e733e6c3e9b28a