Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip getting version from Cython on Android. Instead add ANDROID_PYJNUS_CYTHON_3 env var #692

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down