From patchwork Wed Nov 13 17:16:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Wurmus X-Patchwork-Id: 70374 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CDCDD27BBEA; Wed, 13 Nov 2024 17:34:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3D9C727BBE2 for ; Wed, 13 Nov 2024 17:34:24 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBHFm-0008E3-RL; Wed, 13 Nov 2024 12:34:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBHFl-0008Dr-RE for guix-patches@gnu.org; Wed, 13 Nov 2024 12:34:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBHFl-0005XM-Hh; Wed, 13 Nov 2024 12:34:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=i7DA9NHCXaX01Es9lgYlxsFLPRLQMtFy6Tcw6Up6l9M=; b=Omb+Cs76gWkwvjETz++IZumlTq5pNLl81U1euQpnZVUOu2/cKXglWhIRvrDhIbLhn5ZEJVPglHQEsl8XMiLe9R/9vuEqGTZ+8rl/6YHCkZJ3tN37NbTK7KHfZ/Va1nfWl8wi2Wu9HYK+JJ7H3oEh5AZRdkAv7Mi2e6MmcuyInVM3BuQ8O/grt7G+KMj6DggRPcM43XFKouiixIZLMn9Q0gSNzoc7LtzphKq/NiiAj994s3wArfYzQP+YfVV6/LPsg9fggyVl8fDkNlB4AtJPoQw6t22uzrDVyuvGVoEPnX3FE+lAJjWmbU54fEzWT+BboCIjP0vl+WVpecup8GkedA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBHFh-0001uQ-MT; Wed, 13 Nov 2024 12:34:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74345] [PATCH 7/9] gnu: Add python-awscrt. Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, marius@gnu.org, me@bonfacemunyoki.com, sharlatanus@gmail.com, tanguy@bioneland.org, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Wed, 13 Nov 2024 17:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 74345@debbugs.gnu.org Cc: Ricardo Wurmus , Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , Tanguy Le Carrour , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , Tanguy Le Carrour , jgart Received: via spool by 74345-submit@debbugs.gnu.org id=B74345.17315191877247 (code B ref 74345); Wed, 13 Nov 2024 17:34:01 +0000 Received: (at 74345) by debbugs.gnu.org; 13 Nov 2024 17:33:07 +0000 Received: from localhost ([127.0.0.1]:43455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBHEo-0001sk-GF for submit@debbugs.gnu.org; Wed, 13 Nov 2024 12:33:07 -0500 Received: from sender4-of-o52.zoho.com ([136.143.188.52]:21212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBHEl-0001ro-0V for 74345@debbugs.gnu.org; Wed, 13 Nov 2024 12:33:04 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1731519180; cv=none; d=zohomail.com; s=zohoarc; b=Ne9F8fgWpqH+Y00/U5S1LdReufWTJy1IX92QNpRJIwG/5PXg/M7FvqcA9bSi0F9WsHJ05dG4wGgXq3lqYzJM43EkGHo+6ExuEenP+eJ/4eJhyQzBfnhsmQDCy7Cq4r6D1sC5sRo6rYter2rz6P9MWS01+KFgC/hQa2pCXGbs5Ik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731519180; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=i7DA9NHCXaX01Es9lgYlxsFLPRLQMtFy6Tcw6Up6l9M=; b=NM8tM1uHsYvDsyvUH+Df64yrolADfANORxhcrMYfhVcEpJ8oJHKR+kqOy9f9cx8ujjtOZO5LuJvivXTBl9nT6s/U2nKqlnzFmJNEg4QKWwJgu5Rbxi7kb5dSoEFQO0Yi7r5W2/DNfuB7YGIVXV1cYc+mVg7G4dzq6EtlrnPRyFo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1731519180; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=i7DA9NHCXaX01Es9lgYlxsFLPRLQMtFy6Tcw6Up6l9M=; b=Y5cKEoYbSezQQYnybJsfxu5No1A/oT93IiLt+PuHoUGUEtUEHNyuncdk2MOJHDt5 oMLZhPR2SN+J6HRx6ekLOzhKEidHNtH4tbXnYFQUr6vvOAC0lRFVsCYOMdHpeIOYpkx cTZzk7FXWf/KBXNy8qmEJ2PCu/KV8fx85dmLBi0k= Received: by mx.zohomail.com with SMTPS id 173151821307414.043486895552519; Wed, 13 Nov 2024 09:16:53 -0800 (PST) From: Ricardo Wurmus Date: Wed, 13 Nov 2024 18:16:20 +0100 Message-ID: <0ed3dff312180401873ef5b1b0798096abb3dd95.1731518182.git.rekado@elephly.net> X-Mailer: git-send-email 2.46.0 In-Reply-To: <1c21604f8e3f1bc9784e17f32c140da3c746d0a8.1731518182.git.rekado@elephly.net> References: <1c21604f8e3f1bc9784e17f32c140da3c746d0a8.1731518182.git.rekado@elephly.net> MIME-Version: 1.0 X-ZohoMailClient: External X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-web.scm (python-awscrt): New variable. Change-Id: I1c08a06fdb1ea9811c183d3711f092edd12cdca7 --- gnu/packages/python-web.scm | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index cbec6bf900d..3160c807a1d 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -100,6 +100,7 @@ (define-module (gnu packages python-web) #:use-module (gnu packages bash) #:use-module (gnu packages certs) #:use-module (gnu packages check) + #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages crates-io) #:use-module (gnu packages crates-web) @@ -4132,6 +4133,79 @@ (define-public python-urllib3-next supports url redirection and retries, and also gzip and deflate decoding.") (license license:expat))) +(define-public python-awscrt + (package + (name "python-awscrt") + (version "0.23.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "awscrt" version)) + (sha256 + (base32 "0a669xxfmgw3g6xpcnm64pbmlrbxw5wf3jcrivixscl2glapdxgx")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'disable-broken-tests + (lambda _ + ;; Disable broken tests. These tests fail because the + ;; certificate bundle at the default location does not exist. + (substitute* "test/test_auth.py" + (("def test_default_provider") + "def _test_default_provider")) + (substitute* "test/test_http_client.py" + (("def test_h2_client") + "def _test_h2_client")) + (substitute* "test/test_s3.py" + (("def test_sanity") + "def _test_sanity") + (("def test_sanity_secure") + "def _test_sanity_secure") + (("def test_wait_shutdown") + "def _test_wait_shutdown")))) + (add-after 'unpack 'override-cert-bundle-location + (lambda* (#:key inputs #:allow-other-keys) + (let ((bundle (search-input-file inputs + "/etc/ssl/certs/ca-certificates.crt"))) + (setenv "SSL_CERT_FILE" bundle) + (substitute* "awscrt/io.py" + (("( +)opt = TlsContextOptions\\(\\)" m indent) + (string-append m "\n" + indent "import os\n" + indent "\ +opt.override_default_trust_store_from_path(None, os.getenv('SSL_CERT_FILE')) if os.getenv('SSL_CERT_FILE') else None\n"))) + (substitute* "test/appexit_http.py" + (("( +)tls_ctx_opt = awscrt.io.TlsContextOptions.*" m indent) + (string-append m indent + "tls_ctx_opt.override_default_trust_store_from_path(None, '" + bundle "')\n"))) + (substitute* "test/test_io.py" + (("( +)opt = TlsContextOptions\\(\\).*" m indent) + (string-append m indent + "opt.override_default_trust_store_from_path(None, '" + bundle "')\n")))))) + (add-after 'unpack 'use-system-libraries + (lambda _ + (setenv "AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO" "1"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "-m" "unittest" + "discover" "--verbose"))))))) + (inputs (list openssl)) + (native-inputs (list cmake-minimal + ;; For tests only + nss-certs-for-test + python-boto3 + python-websockets)) + (home-page "https://github.com/awslabs/aws-crt-python") + (synopsis "Common runtime for AWS Python projects") + (description + "This package provides a common runtime for AWS Python projects.") + (license license:asl2.0))) + (define-public awscli (package ;; Note: updating awscli typically requires updating botocore as well.