From patchwork Thu Nov 14 11:52:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sharlatan Hellseher X-Patchwork-Id: 70381 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 5997327BBEA; Thu, 14 Nov 2024 11:55:36 +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=-6.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,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 BB39C27BBE2 for ; Thu, 14 Nov 2024 11:55:35 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBYRQ-0006Fq-5f; Thu, 14 Nov 2024 06:55:16 -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 1tBYRL-0006Am-Oy for guix-patches@gnu.org; Thu, 14 Nov 2024 06:55:12 -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 1tBYRL-0005MG-F1; Thu, 14 Nov 2024 06:55:11 -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=d3oN1MAGaaFuJr9+S0DvRyu9lA9fX6w6rbRLE9lwmzs=; b=Lk5+u3X6QFsLTj+CufLKWPKC7nMdpNx0S2s8ZD181MY07IHFt6l3BKYjcqGunWsWHf4jRifhIewxWIF9nGizvmSEIcaKR/daoLxwOK+3LCW9en/5fmHI+k9FA7VVPHKstoXG3tou0pRs8y6eq2O0WIhHd+0cOYI1pvHwMbsN2SrPyAKXZ/C7rfTVnRCowUMWe5CoxADeGTffrhSZAKIL4YXc52Q+Hi8d7yHrWdP6cP+hoOCRgcTM9Q8eAfV+dNstpPK2gbp2GQt4v2aM78I7XX6PMHgANBq3EfGvqPCVULj/00pWy1acf6D1Lu9xlGHrzaXuVK08uxhq1Q8adNYhoQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBYRJ-0002VE-Jo; Thu, 14 Nov 2024 06:55:09 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74345] [PATCH v2 12/14] gnu: Add python-awscrt. Resent-From: Sharlatan Hellseher 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: Thu, 14 Nov 2024 11:55:09 +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.17315852699392 (code B ref 74345); Thu, 14 Nov 2024 11:55:09 +0000 Received: (at 74345) by debbugs.gnu.org; 14 Nov 2024 11:54:29 +0000 Received: from localhost ([127.0.0.1]:45378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBYQd-0002RH-QZ for submit@debbugs.gnu.org; Thu, 14 Nov 2024 06:54:28 -0500 Received: from mail-wm1-f47.google.com ([209.85.128.47]:48271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBYQQ-0002P2-KS for 74345@debbugs.gnu.org; Thu, 14 Nov 2024 06:54:15 -0500 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4315e9e9642so4944105e9.0 for <74345@debbugs.gnu.org>; Thu, 14 Nov 2024 03:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731585189; x=1732189989; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d3oN1MAGaaFuJr9+S0DvRyu9lA9fX6w6rbRLE9lwmzs=; b=lN+siMKUJai/WsX3/oHpMgVbSM136LtQC2PdEJYQgbaxC7bsOVBR+wX3Dza7beFhGG ONKUZITyjA0KSogEtE5hL3bXOWia8Q+VCYTka9elnETNjJyw7gcduc4JCrcHz3sEjSvX J/X9AVPbyyQbi6fKZ6+4rBU6iJugv10qzXy0+2wH8oHYtUO7Q5FOHotcSNO1Quuitft1 irLPu6EucNjZBHAaFEmrh+UzyZM8LfwCv1HNpfyvoC+huQkVBU2rcXVzhQ9GIs72n+N7 xNUB0zPMcdVqhWE4TQl4kjxOHZDcM2Yak5LyGrxqSjo1+G5IiKi1LRjAbuvfWxMEVcUh yo4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731585189; x=1732189989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d3oN1MAGaaFuJr9+S0DvRyu9lA9fX6w6rbRLE9lwmzs=; b=ptzP9RNwSUmzYoHPUDYT6gv1Mzmsj+JZrZ5KKlSMnvSiE+QPYloNY57TgG3njbsroI 13bFlrcmelVMpGeE0A1SRC3glwmyBUMniG6EafAv4VlfnsIvi8TJnRX/L6CX+Fti7UFL mhUNKXY7GWf0Bjh3Q4RWvjZEqQb/eLJ9pjuw+ViaFsURmF2p8yhgHi1TZUyS1b8xZeR3 tHJBcSTS0CK46+kJGmDlCwq++LFBN27Vqa2zVPuj3uvXFf+/KZ9otEmN0FMtsxKgXQJe FEoZJzy+jcjP0sZXM2ZOLBHd4osJvUnh4fnmjCcnai1+yKbOC4BTklOSikVZgWYZP5fH UUnA== X-Gm-Message-State: AOJu0Yxgsl0CoARPonQKvWfBejxnauq5TQBXU2yEM081rv5M0HR5qPBz u33v4lQ3NrRCBkegSFr30WFFiUVOAcgsNmUrONgX5FZGOnJPJRVwHN4vw4bJqmY= X-Google-Smtp-Source: AGHT+IHMWj0Um5MEaCf+6ySLkJNwFczwDyJm8P14OZjWd3PurGQuLePh/tk8U3CVdXrf+iTzmdwJYw== X-Received: by 2002:a05:6000:2cf:b0:37c:d23f:e465 with SMTP id ffacd0b85a97d-3820df80f94mr5320552f8f.55.1731585188931; Thu, 14 Nov 2024 03:53:08 -0800 (PST) Received: from guxtil.incerto.xyz (cpc100684-bagu15-2-0-cust967.1-3.cable.virginm.net. [86.8.111.200]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae154c3sm1260537f8f.67.2024.11.14.03.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 03:53:08 -0800 (PST) From: Sharlatan Hellseher Date: Thu, 14 Nov 2024 11:52:53 +0000 Message-ID: <7dd6a5b3584d0f73267319c3838fa7c550e30e0d.1731584861.git.sharlatanus@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 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 From: Ricardo Wurmus * 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 32662503a1..eab9a7efc5 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.