aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Peter Korsgaard <peter@korsgaard.com>2020-10-11 15:02:03 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2020-10-12 10:57:26 +0200
commit4c23f2bda4889b354fcf34691330f55406ab8ef0 (patch)
treed3f0be570adf61587caffca4615ec68ec165a7eb
parent896993e3bbf1a2c1a684dd62b3fa0f0e95092a20 (diff)
downloadbuildroot-4c23f2bda4889b354fcf34691330f55406ab8ef0.tar.gz
buildroot-4c23f2bda4889b354fcf34691330f55406ab8ef0.tar.bz2
package/python-sentry-sdk: drop asyncio files for python 2.x to fix pycompile issue
sentry-sdk has a set of optional "integrations", some of which use asyncio. pycompile unfortunately errors out on these files when running under Python 2.x: ../scripts/pycompile.py .. error: File "/usr/lib/python2.7/site-packages/sentry_sdk/integrations/sanic.py", line 64 async def sentry_handle_request(self, request, *args, **kwargs): ^ SyntaxError: invalid syntax As a workaround, simply drop the unusable files from TARGET_DIR if building for python 2.x. Fixes: http://autobuild.buildroot.net/results/9e4/9e47ee2a56153379e4e7bc839be5972a2302ba9f/ Signed-off-by: Peter Korsgaard <peter@korsgaard.com> (cherry picked from commit d62f0042e85c8a39608dc7ad6a491460791dfbfa) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/python-sentry-sdk/python-sentry-sdk.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/package/python-sentry-sdk/python-sentry-sdk.mk b/package/python-sentry-sdk/python-sentry-sdk.mk
index 13495047b9..3bfd95a47f 100644
--- a/package/python-sentry-sdk/python-sentry-sdk.mk
+++ b/package/python-sentry-sdk/python-sentry-sdk.mk
@@ -11,4 +11,14 @@ PYTHON_SENTRY_SDK_SETUP_TYPE = setuptools
PYTHON_SENTRY_SDK_LICENSE = BSD-2-Clause
PYTHON_SENTRY_SDK_LICENSE_FILES = LICENSE
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+# only needed/valid for python 3.x
+define PYTHON_SENTRY_SDK_RM_PY3_FILES
+ rm -f $(addprefix $(TARGET_DIR)/usr/lib/python*/site-packages/sentry_sdk/integrations/,\
+ aiohttp.py asgi.py django/asgi.py sanic.py tornado.py)
+endef
+
+PYTHON_SENTRY_SDK_POST_INSTALL_TARGET_HOOKS += PYTHON_SENTRY_SDK_RM_PY3_FILES
+endif
+
$(eval $(python-package))