From patchwork Tue May 19 07:46:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 22208 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 300F427BBE3; Tue, 19 May 2020 08:47:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 770EE27BBE1 for ; Tue, 19 May 2020 08:47:08 +0100 (BST) Received: from localhost ([::1]:55536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jawxv-0004fe-Tt for patchwork@mira.cbaines.net; Tue, 19 May 2020 03:47:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jawxq-0004fI-Pc for guix-patches@gnu.org; Tue, 19 May 2020 03:47:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jawxq-0006rt-H1 for guix-patches@gnu.org; Tue, 19 May 2020 03:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jawxq-0004SX-FI for guix-patches@gnu.org; Tue, 19 May 2020 03:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41393] [PATCH] gnu: python-shouldbe: Python 3.8 compatibility Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 May 2020 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41393 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41393@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158987442117132 (code B ref -1); Tue, 19 May 2020 07:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 May 2020 07:47:01 +0000 Received: from localhost ([127.0.0.1]:49088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jawxo-0004SG-Pd for submit@debbugs.gnu.org; Tue, 19 May 2020 03:47:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:54608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jawxl-0004S7-T0 for submit@debbugs.gnu.org; Tue, 19 May 2020 03:47:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jawxl-0004f2-It for guix-patches@gnu.org; Tue, 19 May 2020 03:46:57 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:37437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jawxh-0006qO-B4 for guix-patches@gnu.org; Tue, 19 May 2020 03:46:57 -0400 Received: by mail-wm1-x341.google.com with SMTP id z72so2280283wmc.2 for ; Tue, 19 May 2020 00:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leibniz-psychology-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=zgh8vkVjhJKJhC2O1q+/6ckfpGh3hLgOcofES5FKf08=; b=Z3x8IbWwgfH/Cvq/cb1P4pzSSDCuOV6wMQtfr03/LYRZ6woUqkmxq7m4PAsDKeVRK/ GiJ2Gonl3zt5+XP72ITRjixLmypHkqzby72okJ9fmZq4fXPZtfoax/Iwzy8XNI1QHSl1 iJ9ziS+X322VDjTU8KwpBfijJIHfd8/gb75Y+qxBsgs3UjD/VKYACeTqNkDoNtJG/CHP wALdkjUJjkT3xnNhyXVD8+HS24qInyrBcqlbDKS+G08obNflbFgSrzJxB7FuA2+kAWOp VQY2FqlPgDJYlTIc/yKbL0qvsxrKN9JI+dN9Fpr8ioXCqNLTKokkVZKNEWioaEX8Gn5R kwLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=zgh8vkVjhJKJhC2O1q+/6ckfpGh3hLgOcofES5FKf08=; b=K9O3cO6DVqohHuH97Bnk/N1LRTqU7pobNMFCAb0QSgHcZBBAk6wnaoSS4Vdg3bxV3h wm3RLBlorhg0L6CQPaVBTXm+rePvW65f633ClcBCNQlilntyiLzwQzBKo9RNnudi4nJq ncd1buCYIIerAE9N1+yEdsg5CoDT3mtG+V6GjBEJzGpo2mggOR31mfZgvR4H5khmvZwd bZTNihsUl2sAUtimmFtWQnEsq1kkvAwHJeKgRqhrmE3KH1g2tOZmJJbq5JrGSym5CZ48 h1qMHVgqUXCa05UpGhOJB4bl8qz82uDUFNoSsbnRwajdK9wtsZfzEOOltFuKK5b2GvBC /7PA== X-Gm-Message-State: AOAM530oRDnEd2aWibvrxtEATVmfmk7ZUAsak32/UCN58hs6H3x//cTd P1q5IgvUNOAEgmyawiuPQSQdCQ2DBhV9UXg4WF9zI5uGGACF8e2XNaO09NxpR9LJb9xfBOSF4MV k451n63G9xlTU52yLBxBdkWN6AtDWI4vOj3fJ6OPdappr2a2QR8MRkIlgusDsUoO26ysLuxfGZE rZCbwy0HE= X-Google-Smtp-Source: ABdhPJzUgHQnA5o0sMpJzGrbIHmTgDX+JbzEu1DVn91apwqVqYxSJq1gnesz510TAd5sFqZPv4J0SA== X-Received: by 2002:a1c:2087:: with SMTP id g129mr3740959wmg.126.1589874410940; Tue, 19 May 2020 00:46:50 -0700 (PDT) Received: from localhost (dynamic-2a01-0c23-7850-5200-7d0a-d634-6a10-7df9.c23.pool.telefonica.de. [2a01:c23:7850:5200:7d0a:d634:6a10:7df9]) by smtp.gmail.com with ESMTPSA id f8sm18877700wrm.8.2020.05.19.00.46.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 00:46:50 -0700 (PDT) Date: Tue, 19 May 2020 09:46:49 +0200 From: Lars-Dominik Braun Message-ID: <20200519074649.GA11910@zpidnp36> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: none client-ip=2a00:1450:4864:20::341; envelope-from=ldb@leibniz-psychology.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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" X-getmail-retrieved-from-mailbox: Patches Upstream issue: https://github.com/DirectXMan12/should_be/pull/5 * gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch: Add compatibility patch * gnu/local.mk (dist_patch_DATA): Add new file * gnu/packages/python-xyz.scm (python-shouldbe)[source]: Add patch --- gnu/local.mk | 1 + .../python-shouldbe-0.1.2-cpy3.8.patch | 78 +++++++++++++++++++ gnu/packages/python-xyz.scm | 3 +- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch diff --git a/gnu/local.mk b/gnu/local.mk index 38b286203e..7ab5882f1b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1432,6 +1432,7 @@ dist_patch_DATA = \ %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ %D%/packages/patches/python-robotframework-honor-source-date-epoch.patch \ + %D%/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch \ %D%/packages/patches/python-slugify-depend-on-unidecode.patch \ %D%/packages/patches/python2-subprocess32-disable-input-test.patch \ %D%/packages/patches/python-unittest2-python3-compat.patch \ diff --git a/gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch b/gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch new file mode 100644 index 0000000000..0a80d15cd2 --- /dev/null +++ b/gnu/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch @@ -0,0 +1,78 @@ +diff -x '*.pyc' -Naur shouldbe-0.1.2/should_be/core.py shouldbe-0.1.2.patched/should_be/core.py +--- shouldbe-0.1.2/should_be/core.py 2019-03-06 07:38:22.000000000 +0100 ++++ shouldbe-0.1.2.patched/should_be/core.py 2020-05-18 08:44:24.214664704 +0200 +@@ -103,7 +103,7 @@ + return resf + + +-def buildCode(baseCode, argcount=None, kwonlyargcount=None, ++def buildCode(baseCode, argcount=None, posonlyargcount=None, kwonlyargcount=None, + nlocals=None, stacksize=None, flags=None, + code=None, consts=None, names=None, + varnames=None, filename=None, name=None, +@@ -121,6 +121,24 @@ + nlocals or baseCode.co_nlocals, + stacksize or baseCode.co_stacksize, + flags or baseCode.co_flags, ++ code or baseCode.co_code, ++ consts or baseCode.co_consts, ++ names or baseCode.co_names, ++ varnames or baseCode.co_varnames, ++ filename or baseCode.co_filename, ++ name or baseCode.co_name, ++ firstlineno or baseCode.co_firstlineno, ++ lnotab or baseCode.co_lnotab, ++ freevars or baseCode.co_freevars, ++ cellvars or baseCode.co_cellvars) ++ elif hasattr(baseCode, 'co_posonlyargcount'): ++ # Python 3.8 ++ resc = CodeType(argcount or baseCode.co_argcount, ++ posonlyargcount or baseCode.co_posonlyargcount, ++ kwonlyargcount or baseCode.co_kwonlyargcount, ++ nlocals or baseCode.co_nlocals, ++ stacksize or baseCode.co_stacksize, ++ flags or baseCode.co_flags, + code or baseCode.co_code, + consts or baseCode.co_consts, + names or baseCode.co_names, +diff -x '*.pyc' -Naur shouldbe-0.1.2/should_be/tests/test_container_mixin.py shouldbe-0.1.2.patched/should_be/tests/test_container_mixin.py +--- shouldbe-0.1.2/should_be/tests/test_container_mixin.py 2019-03-01 06:38:16.000000000 +0100 ++++ shouldbe-0.1.2.patched/should_be/tests/test_container_mixin.py 2020-05-18 09:00:51.372531064 +0200 +@@ -7,31 +7,31 @@ + self.lst = [1, 2, 3] + + def test_should_include_iter(self): +- err_msg = (r'[a-zA-Z0-9.]+ should have included \[.+?\]' ++ err_msg = (r'[a-zA-Z0-9.()]+ should have included \[.+?\]' + r', but did not have items .+') +- self.assertRaisesRegexp(AssertionError, err_msg, ++ self.assertRaisesRegex(AssertionError, err_msg, + self.lst.should_include, [4]) + + self.lst.should_include([1, 2, 3]) + + def test_should_include_item(self): +- err_msg = (r'[a-zA-Z0-9.]+ should have included .+?' ++ err_msg = (r'[a-zA-Z0-9.()]+ should have included .+?' + r', but did not') +- self.assertRaisesRegexp(AssertionError, err_msg, ++ self.assertRaisesRegex(AssertionError, err_msg, + self.lst.should_include, 4) + + self.lst.should_include(3) + + def test_shouldnt_include_iter(self): + err_msg = 'should not have included' +- self.assertRaisesRegexp(AssertionError, err_msg, ++ self.assertRaisesRegex(AssertionError, err_msg, + self.lst.shouldnt_include, [2, 3]) + + self.lst.shouldnt_include([4, 5]) + + def test_shouldnt_include_item(self): + err_msg = 'should not have included' +- self.assertRaisesRegexp(AssertionError, err_msg, ++ self.assertRaisesRegex(AssertionError, err_msg, + self.lst.shouldnt_include, 3) + + self.lst.shouldnt_include(4) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index c26a766d64..00a4fd51c4 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -18749,7 +18749,8 @@ and cuts down boilerplate code when testing libraries for asyncio.") (uri (pypi-uri "shouldbe" version)) (sha256 (base32 - "16zbvjxf71dl4yfbgcr6idyim3mdrfvix1dv8b95p0s9z07372pj")))) + "16zbvjxf71dl4yfbgcr6idyim3mdrfvix1dv8b95p0s9z07372pj")) + (patches (search-patches "python-shouldbe-0.1.2-cpy3.8.patch")))) (build-system python-build-system) (propagated-inputs `(("python-forbiddenfruit" ,python-forbiddenfruit)))