[Buildroot] [PATCH 1/1] package/python-attrs: remove _next_gen.py on python2

Asaf Kahlon asafka7 at gmail.com
Thu Sep 23 18:37:49 UTC 2021


The _next_gen.py file contains python 3.6+ API and it's not
useable with python 2.
In addition, this file is imported on __init__.py only after
checking the version of python is above 3.6, so we can safely
remove it.

Fixes:
 - http://autobuild.buildroot.net/results/5774c6237b72b6f5e005bb5b229c078235ff2741/

Signed-off-by: Asaf Kahlon <asafka7 at gmail.com>
---
 package/python-attrs/python-attrs.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/python-attrs/python-attrs.mk b/package/python-attrs/python-attrs.mk
index b99a98501c..f23cabd998 100644
--- a/package/python-attrs/python-attrs.mk
+++ b/package/python-attrs/python-attrs.mk
@@ -11,4 +11,13 @@ PYTHON_ATTRS_SETUP_TYPE = setuptools
 PYTHON_ATTRS_LICENSE = MIT
 PYTHON_ATTRS_LICENSE_FILES = LICENSE
 
+# _next_gen is usable only on python 3.6+ and it's not imported
+# on __init__.py in case lower version of python is used.
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+define PYTHON_ATTRS_REMOVE_NEXT_GEN
+        $(RM) $(@D)/src/attr/_next_gen.py
+endef
+PYTHON_ATTRS_POST_PATCH_HOOKS += PYTHON_ATTRS_REMOVE_NEXT_GEN
+endif
+
 $(eval $(python-package))
-- 
2.30.2



More information about the buildroot mailing list