From patchwork Fri Oct 2 13:40:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 1375766 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=vCRDwPbH; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C2rjq41Xkz9sSC for ; Fri, 2 Oct 2020 23:41:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id ED5BC86538; Fri, 2 Oct 2020 13:40:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VbbL3g4c-Xso; Fri, 2 Oct 2020 13:40:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5EC8C86559; Fri, 2 Oct 2020 13:40:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E4E501BF9B9 for ; Fri, 2 Oct 2020 13:40:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DBAE786559 for ; Fri, 2 Oct 2020 13:40:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WITvb9OK0HKY for ; Fri, 2 Oct 2020 13:40:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 3BFF686538 for ; Fri, 2 Oct 2020 13:40:54 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id i26so2016715ejb.12 for ; Fri, 02 Oct 2020 06:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lGLgRfz3Qosb8rgxRZe4699Rb3KqBeP5cW9/5hbRI3A=; b=vCRDwPbH7g1falfIsGJQDQUJcXeg2vBuH6NBM79+88OnN/y8lbPj64cJb6CqwXUx4Q 3uZuzRUjg/8nwYtYS5vVOX9s/qkQ6LuJ8mu0IcPQOF/wcFTq2QQ9kth7HEc7ABy5h1sG ZJfERnZ5pjUp4e/BxvlcJpJEGn67axxCkHIC3ShsmHuHvoILBGZhMG5I5JWly1WqWOZU f55UKX6bGxtWw+HW6ZQpgHohXrk4Ol9x74GCPSJEV1SQBhbDNRS9wom3SDMiIpTB0+UB 0V0CdtVJ5zeXHBCi++7VqnBgWRzJ1cB/iP0nidlsFuWLjsyX+qIoAnbMh4fWD/WQaDYT vVTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=lGLgRfz3Qosb8rgxRZe4699Rb3KqBeP5cW9/5hbRI3A=; b=gMv74cEgZEPzWCZVaCOfMCwdDxd9kZWMQj5p2AXAmla1kkzOr0HAoS6kTMVhe+m+d8 DrL3qkTcYJDuRtx1n99Rl5IgIUOqgKFLMjLlxgrfUudlv6SSA1coynGU6s6gIB4OMOTv /ZK4JPnm5ghUSMCPIGxZmW+xXJcgMVE9aPJRT+PSiHoBT2BPs/xj59JDiSd0YhNb+7GZ EIr6PR5vdVOhXz46RPhWvVDvPCLvc+oYiBJEw4aN+3DLP3aV3toYRerBEN5D3fJh5j4/ zkAhf9Y+t/HLOYAHnKEzcT9T3bVZnV11e+KXDHbBATkXpDEE1gVo0ntmp8ucHG0GjAPN WveQ== X-Gm-Message-State: AOAM533848Qulk4LTX0xyhrn0EuvTUlOIr9YGfvFVoEdmzfEOzLJn70n kBXiKoakcgtTg+NbsiT9Ye1zTgMwMIQ= X-Google-Smtp-Source: ABdhPJzDtDJ307M2ykuthcumoLVo4EgzRHeHrFINR7Hd7C6m3rsGxQ82rtAxjKIVVoKsO7ea1Urr2w== X-Received: by 2002:a17:906:14d8:: with SMTP id y24mr2223890ejc.123.1601646051870; Fri, 02 Oct 2020 06:40:51 -0700 (PDT) Received: from dell.be.48ers.dk (d51A5BC31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id a20sm1183793edr.9.2020.10.02.06.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 06:40:50 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.92) (envelope-from ) id 1kOLIo-0006NW-6E; Fri, 02 Oct 2020 15:40:50 +0200 From: Peter Korsgaard To: buildroot@buildroot.org Date: Fri, 2 Oct 2020 15:40:47 +0200 Message-Id: <20201002134048.24473-1-peter@korsgaard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] package/python-aenum: drop test_v3.py file for python 2.x to fix pycompile issue X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Korsgaard , Asaf Kahlon Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/4ca459d54545c0e20b0f0cdc63bd81844ecd7f36/ aenum has conditional logic to load python 3.x code located in test_v3.py: if pyver >= 3.0: from aenum.test_v3 import TestEnumV3, TestOrderV3, TestNamedTupleV3 And contains logic in setup.py to drop that file during setup.py install if building for python 2.x: py3_only = ('aenum/test_v3.py', ) .. if __name__ == '__main__': if 'install' in sys.argv: import os, sys .. if sys.version_info[0] != 3: for file in py3_only: try: os.unlink(file) But this doesn't work in Buildroot as pkg-python.dk first does setup.py build (which copies test_v3.py to the build directory) before setup.py install, so test_v3.py gets installed, leading to errors from pycompile: error: File "/usr/lib/python2.7/site-packages/aenum/test_v3.py", line 12 class MagicAutoNumberEnum(Enum, settings=AutoNumber): ^ SyntaxError: invalid syntax As a workaround, add a hook to drop it from the target directory when building for python 2.x. Signed-off-by: Peter Korsgaard --- package/python-aenum/python-aenum.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/python-aenum/python-aenum.mk b/package/python-aenum/python-aenum.mk index 1d5322ef41..97fcbb5e86 100644 --- a/package/python-aenum/python-aenum.mk +++ b/package/python-aenum/python-aenum.mk @@ -11,4 +11,13 @@ PYTHON_AENUM_SETUP_TYPE = setuptools PYTHON_AENUM_LICENSE = BSD-3-Clause PYTHON_AENUM_LICENSE_FILES = aenum/LICENSE +ifeq ($(BR2_PACKAGE_PYTHON),y) +# only needed/valid for python 3.x +define PYTHON_AENUM_RM_PY3_FILE + rm -f $(TARGET_DIR)/usr/lib/python*/site-packages/aenum/test_v3.py +endef + +PYTHON_AENUM_POST_INSTALL_TARGET_HOOKS += PYTHON_AENUM_RM_PY3_FILE +endif + $(eval $(python-package)) From patchwork Fri Oct 2 13:40:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 1375767 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=CScMvT3d; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C2rjr0t0Dz9sSs for ; Fri, 2 Oct 2020 23:41:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4DEDC204D4; Fri, 2 Oct 2020 13:41:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wZ939BMX5sDH; Fri, 2 Oct 2020 13:40:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8D99A273CF; Fri, 2 Oct 2020 13:40:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id CE92E1BF2E3 for ; Fri, 2 Oct 2020 13:40:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CABC2872FD for ; Fri, 2 Oct 2020 13:40:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rA508ZR6H+KH for ; Fri, 2 Oct 2020 13:40:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by hemlock.osuosl.org (Postfix) with ESMTPS id 96B35872FB for ; Fri, 2 Oct 2020 13:40:54 +0000 (UTC) Received: by mail-ed1-f47.google.com with SMTP id 33so1657907edq.13 for ; Fri, 02 Oct 2020 06:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BabIoCr+M1XftitOPD7T9t1w2N6E9HHTf3Q3C12peZk=; b=CScMvT3d2Yh5T+JNy29oiKALztocul//rTt/+6JpjCBzHkex9uoYx7K5+x9dnLRSez giQs6igvSgjqDRXULo9UeHmmDJo1Hn6t1ge0IH1OXxMRqFNI4u2hrzvMtjspc3xbXLx/ yTMKyWyWiPqe22zovtnZBShc2mCRMwtgJkGbiKryzYPocbIrbN0gWePoWUZ2kUwmTTYF 1u3xL5f07S+TtBDSIVDnfOuXx64FpsS2rOczOCMisfWFIeWQcJnDCtmRamILp77dnkIb yFb8xK6Vcf/yHxdR0lDZWFcb/tRRBpQNO6xQ3bd6uGsvOmYAhurfg5WzR3zNGHzHsBQL sGhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BabIoCr+M1XftitOPD7T9t1w2N6E9HHTf3Q3C12peZk=; b=A/n9vXIpwBs5e8JUY3lS2jA4X5qelAZlY4QbUMKn3iy4fXDFqkKzNHabFO2K+GHQkm hf/3z4CEz1tvz9LKuI48Hvx4D1oEsFHLL1Jh9Yf3k41dddGXAMoh9xKv1tR2OltizT5/ 7tBn5FQ7Ifdqgmdf7HniACKdnzQ699nkDxDEWPcW+WfE7cIFj/RJG3e8gtvARJN6TnJ9 f9L/VOD+3ca6UbFYRMGS947ni5LB0MasOvRJvvLfWUxF9dc9pcww09LBAvxt9gZDhwIf TJ296lB39jlUT/KygvZQNgTcU9rs0pMA0pYkg/T/G5PnGL9naAQrzenCZWIRpZ9TYRNc ETwQ== X-Gm-Message-State: AOAM530pEUrLtyoNTEJaLk0AAjtFNjh3M+RUKgC379G5u9WxsoENdi7/ QL1jbMKzBuFMDjfOPQzdlmDSRFI19eM= X-Google-Smtp-Source: ABdhPJxSnHLNW+XlM2Q30fiNv+Sl+Tzsb1ZucLRMxjD4sEiaknHWJcVuJ+Z5eZhYLB+Ul79fjSX6Dw== X-Received: by 2002:a05:6402:8d3:: with SMTP id d19mr2362615edz.68.1601646052798; Fri, 02 Oct 2020 06:40:52 -0700 (PDT) Received: from dell.be.48ers.dk (d51A5BC31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id u18sm1172009ejm.115.2020.10.02.06.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 06:40:51 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.92) (envelope-from ) id 1kOLIo-0006Nb-K3; Fri, 02 Oct 2020 15:40:50 +0200 From: Peter Korsgaard To: buildroot@buildroot.org Date: Fri, 2 Oct 2020 15:40:48 +0200 Message-Id: <20201002134048.24473-2-peter@korsgaard.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201002134048.24473-1-peter@korsgaard.com> References: <20201002134048.24473-1-peter@korsgaard.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] package/python-fire.mk: drop test_components_py3.py file for python 2.x to fix pyfile issue X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Korsgaard , Asaf Kahlon Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/72e0cc78194a1b93bf26a50742e59a1e93bde1d1/ fire has conditional logic to load test_components_py3.py when running under Python 3.x: if six.PY3: from fire import test_components_py3 as py3 pycompile unfortunately errors out on it: ../scripts/pycompile.py .. error: File "/usr/lib/python2.7/site-packages/fire/test_components_py3.py", line 18 def identity(arg1, arg2: int, arg3=10, arg4: int = 20, *arg5, ^ SyntaxError: invalid syntax As a workaround, simply drop the unusable _py3 file from TARGET_DIR if building for python 2.x. Signed-off-by: Peter Korsgaard --- package/python-fire/python-fire.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/python-fire/python-fire.mk b/package/python-fire/python-fire.mk index 343abbca7d..f6a2e073f0 100644 --- a/package/python-fire/python-fire.mk +++ b/package/python-fire/python-fire.mk @@ -11,4 +11,13 @@ PYTHON_FIRE_SETUP_TYPE = setuptools PYTHON_FIRE_LICENSE = Apache-2.0 PYTHON_FIRE_LICENSE_FILES = LICENSE +ifeq ($(BR2_PACKAGE_PYTHON),y) +# only needed/valid for python 3.x +define PYTHON_FIRE_RM_PY3_FILE + rm -f $(TARGET_DIR)/usr/lib/python*/site-packages/fire/test_components_py3.py +endef + +PYTHON_FIRE_POST_INSTALL_TARGET_HOOKS += PYTHON_FIRE_RM_PY3_FILE +endif + $(eval $(python-package))