Initial package

Resolves: RHEL-12453

Signed-off-by: Major Hayden <mhayden@redhat.com>
This commit is contained in:
Major Hayden 2024-01-31 14:03:22 -06:00
parent c54c97bb0b
commit db63067637
No known key found for this signature in database
5 changed files with 106 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/awscrt-0.16.16.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

86
python-awscrt.spec Normal file
View File

@ -0,0 +1,86 @@
%global desc %{expand:
Python bindings for the AWS Common Runtime}
Name: python-awscrt
Version: 0.16.16
Release: 1%{?dist}
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
# - crt/aws-c-common/source/external/cJSON.c is MIT
# - 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
Patch1: skip-test-requiring-network.patch
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: openssl-devel
BuildRequires: python%{python3_pkgversion}-websockets
# https://bugzilla.redhat.com/show_bug.cgi?id=2180988
ExcludeArch: s390x
%description
%{desc}
%package -n python%{python3_pkgversion}-awscrt
Summary: %{summary}
%description -n python%{python3_pkgversion}-awscrt
%{desc}
%prep
%autosetup -p1 -n awscrt-%{version}
%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
* Wed Apr 26 2023 Nikola Forró <nforro@redhat.com> - 0.16.16-1
- New upstream release 0.16.16
* Wed Mar 22 2023 Nikola Forró <nforro@redhat.com> - 0.16.13-2
- Workaround a crash on %%ix86
* Thu Mar 16 2023 Nikola Forró <nforro@redhat.com> - 0.16.13-1
- Initial package

View File

@ -0,0 +1,12 @@
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)

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (awscrt-0.16.16.tar.gz) = 5c94d6a33efc6000361283dc59d49a09bf7943c317fb5ef29bea3d7bc265420ae147510417fe7c0901fe71f3e5baf6235044b994a6cc03278a332c34df2b6e91