Skip to content

Conversation

T-Dynamos
Copy link
Contributor

@T-Dynamos T-Dynamos commented Jul 26, 2025

This PR adds python 3.14 support, we can't set default version to 3.14 just yet as in latest python, distutils was removed, so a lot of recipes need updating.

Closes #3219

@T-Dynamos T-Dynamos force-pushed the python-update branch 2 times, most recently from a483a9d to 24d1da9 Compare July 26, 2025 19:13
@T-Dynamos T-Dynamos changed the title [WIP] python: update to 3.13 python: update to 3.13 Aug 16, 2025
@T-Dynamos T-Dynamos force-pushed the python-update branch 6 times, most recently from 6c99220 to d54d5a7 Compare August 17, 2025 05:51
@T-Dynamos T-Dynamos force-pushed the python-update branch 7 times, most recently from dc86b9e to 308d126 Compare August 19, 2025 14:11
@T-Dynamos T-Dynamos changed the title python: update to 3.13 python: add 3.13 support Aug 20, 2025
@T-Dynamos T-Dynamos force-pushed the python-update branch 6 times, most recently from fc5223d to ecb34a7 Compare August 20, 2025 06:20
@T-Dynamos T-Dynamos dismissed stale reviews from AndreMiras and kuzeyron via 7473c1e October 4, 2025 18:30
@kuzeyron kuzeyron removed the PR-tested PR has been tested label Oct 5, 2025
@cclauss
Copy link
Contributor

cclauss commented Oct 7, 2025

Should Python 3.13 be added to the automated testing?

python-version: ['3.8', '3.9', '3.10', '3.11']

What about Python 3.14 and 3.14t (free threaded)?

@T-Dynamos
Copy link
Contributor Author

T-Dynamos commented Oct 7, 2025

@cclauss I did tested python build with --disable-gil option, and there were some segmentation fault errors.

It's an experimental option given in recipe class:

https://github.com/kivy/python-for-android/pull/3180/files#diff-6aaa5c7168576825b0ac43915df1873d45e5594eee8189ec7c717cf89bcfe400R178-R184

Does 3.14t has some special android support?

And regarding adding them to the test workflow, we can’t do that just yet, since other recipes still need to be ported to PyProjectRecipe; otherwise, they will fail on Python 3.13 and above.

@cclauss
Copy link
Contributor

cclauss commented Oct 7, 2025

@cclauss
Copy link
Contributor

cclauss commented Oct 7, 2025

Python 3.14 (the π version) was released 30 minutes ago.
https://www.python.org/downloads/release/python-3140/
https://github.com/actions/python-versions/releases

@T-Dynamos T-Dynamos changed the title python: add 3.13 support python: add 3.14 support Oct 7, 2025
@T-Dynamos T-Dynamos marked this pull request as draft October 7, 2025 15:25
@T-Dynamos T-Dynamos force-pushed the python-update branch 2 times, most recently from 5748977 to 4592ee3 Compare October 7, 2025 16:45
@T-Dynamos T-Dynamos marked this pull request as ready for review October 7, 2025 16:45
@T-Dynamos T-Dynamos requested a review from AndreMiras October 7, 2025 16:46
@cclauss
Copy link
Contributor

cclauss commented Oct 7, 2025

I would feel more comfortable about this if GitHub Actions tests were being run.

python-version: ['3.8', '3.9', '3.10', '3.11']

-->

        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']

Copy link
Contributor

@kuzeyron kuzeyron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps bumping python3 & hostpython3 to 3.14 would be great?

@T-Dynamos
Copy link
Contributor Author

@kuzeyron Maybe another PR for that as other recipes need to be updated to support python 3.14.

Currently errors like this occur:

[INFO]:    Building six for x86
[INFO]:    six apparently isn't already in site-packages
[INFO]:    Installing six into site-packages
[INFO]:    -> directory context /home/tdynamos/Experiments/Genric/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a_x86_x86_64/build/other_builds/six/x86__ndk_target_24/six
[DEBUG]:   -> running python3 setup.py install -O2 --root=/home/tdynamos/Experiments/Genric/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a_x86_x86_64/build/python-installs/myapp/x86 --install-lib=.
[DEBUG]:   	Traceback (most recent call last):
[DEBUG]:   	 File "/home/tdynamos/Experiments/Genric/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a_x86_x86_64/build/other_builds/six/x86__ndk_target_24/six/setup.py", line 27, in <module>
[DEBUG]:   	   from setuptools import setup
[DEBUG]:   	ModuleNotFoundError: No module named 'setuptools'
[DEBUG]:   	
[DEBUG]:   	During handling of the above exception, another exception occurred:
[DEBUG]:   	
[DEBUG]:   	Traceback (most recent call last):
[DEBUG]:   	 File "/home/tdynamos/Experiments/Genric/.buildozer/android/platform/build-armeabi-v7a_arm64-v8a_x86_x86_64/build/other_builds/six/x86__ndk_target_24/six/setup.py", line 29, in <module>
[DEBUG]:   	   from distutils.core import setup
[DEBUG]:   	ModuleNotFoundError: No module named 'distutils'

Distutils was removed in recent python versions.
Fix is to switch to PyProjectRecipe and update version of every failing recipe.

@kuzeyron kuzeyron added the PR-tested PR has been tested label Oct 8, 2025
@cclauss
Copy link
Contributor

cclauss commented Oct 8, 2025

ModuleNotFoundError: No module named 'setuptools'

Setuptools has some parts of distutils left in it, so `pip install setuptools; python_version>="3.13" might be a short-term solution.

@T-Dynamos
Copy link
Contributor Author

@cclauss But distutils import will still fail as it is hardcoded in setup.py files.

@cclauss
Copy link
Contributor

cclauss commented Oct 8, 2025

uv run --python=3.14 --with=setuptools setup.py

@cclauss
Copy link
Contributor

cclauss commented Oct 8, 2025

In general, we want to move away from setup.py and toward pyproject.toml.

We also want to drop six which is deprecated because Python 2 died long ago (1/1/2020).

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thank you for the effort

@kuzeyron kuzeyron merged commit 6b66944 into kivy:develop Oct 8, 2025
41 checks passed
@T-Dynamos T-Dynamos deleted the python-update branch October 8, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-providers Core code that's not a recipe PR-tested PR has been tested recipe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pillow recipe is causing errors
5 participants