From e0f52ba87b2b84b040eb13200a96eed4cd5b22c5 Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Fri, 3 Nov 2023 18:44:04 +0100 Subject: [PATCH] Skip getting version from Cython on Android. Instead add ANDROID_PYJNIUS_CYTHON_3 env var (#692) --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 012735b2..3cca8c1a 100644 --- a/setup.py +++ b/setup.py @@ -87,8 +87,11 @@ def compile_native_invocation_handler(java): # generate the config.pxi with open(join(dirname(__file__), 'jnius', 'config.pxi'), 'w') as fd: - import Cython - cython3 = Cython.__version__.startswith('3.') + if PLATFORM == 'android': + cython3 = environ.get('ANDROID_PYJNIUS_CYTHON_3', '0') == '1' + else: + import Cython + cython3 = Cython.__version__.startswith('3.') fd.write('DEF JNIUS_PLATFORM = {0!r}\n\n'.format(PLATFORM)) # record the Cython version, to address #669 fd.write(f'DEF JNIUS_CYTHON_3 = {cython3}')