From a601d968e532adaf70b2a1abdd1c8ef4c4e11819 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 12 Oct 2026 09:23:34 +0200 Subject: [PATCH] android: allow Cython 3.1, like the pyjnius recipe does The android recipe depends on pyjnius, so pyjnius is always built immediately before it, and both install their prerequisites into one shared hostpython site-packages. Each recipe does that with its own `pip install --upgrade` call, so pip resolves each call against that call's specifier alone: pyjnius' Cython<3.2 installs 3.1.8, then android's Cython>=0.29,<3.1 uninstalls it and downloads 3.0.12. Both bounds do admit 3.0.x, but nothing tells pip to settle there. Raise the android bound to <3.2 so the second call is a no-op. pyjnius has allowed Cython<3.2 since it moved to 1.7.0 (9774cec2), while android stayed at <3.1 from its PyProjectRecipe conversion (d045912b); the divergence looks incidental. The pyproject.toml bound moves with it, as that is what governs the isolated wheel build. Cython 3.1.8 cythonizes all three android extension modules, and the compile-time IF in _android.pyx still resolves per bootstrap, though it now warns that IF is deprecated and slated for removal. --- pythonforandroid/recipes/android/__init__.py | 2 +- pythonforandroid/recipes/android/src/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/recipes/android/__init__.py b/pythonforandroid/recipes/android/__init__.py index fcf2c069ba..308c525b78 100644 --- a/pythonforandroid/recipes/android/__init__.py +++ b/pythonforandroid/recipes/android/__init__.py @@ -13,7 +13,7 @@ class AndroidRecipe(IncludedFilesBehaviour, PyProjectRecipe): src_filename = 'src' depends = [('sdl3', 'sdl2', 'genericndkbuild'), 'pyjnius'] - hostpython_prerequisites = ["Cython>=0.29,<3.1"] + hostpython_prerequisites = ["Cython>=0.29,<3.2"] config_env = {} diff --git a/pythonforandroid/recipes/android/src/pyproject.toml b/pythonforandroid/recipes/android/src/pyproject.toml index bb5f8b4fa4..db2a6e2be1 100644 --- a/pythonforandroid/recipes/android/src/pyproject.toml +++ b/pythonforandroid/recipes/android/src/pyproject.toml @@ -2,6 +2,6 @@ requires = [ "setuptools", "wheel", - "Cython>=0.29,<3.1" + "Cython>=0.29,<3.2" ] build-backend = "setuptools.build_meta"