-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Remove distutils
usage, as is not available anymore on Python 3.12
#2912
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
Conversation
caadfb2
to
3099c4d
Compare
@Julian-O , I've seen I touched some of your code, so added you as a reviewer 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me.
There were some failing MacOs tests - I cant read the full logs from this tablet, but I assume they are unrelated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thanks
@@ -191,8 +187,9 @@ def check_ndk_api(ndk_api, android_api): | |||
|
|||
MIN_PYTHON_MAJOR_VERSION = 3 | |||
MIN_PYTHON_MINOR_VERSION = 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope, but I'm wondering, is 3.6 still the minor recommended version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd encourage upgrading to Python 3.8 as a minimum, but I see that as a project decision.
-
Python 3.6 and Python 3.7 are end of life. Python 3.8 has just under a year left of security support.
-
The latest released version of Buildozer claims to support back to 3.6. The in-dev version is 3.8 minimum.
-
The latest released version of Kivy claims to support back to 3.7. The in-dev version is 3.7 minimum.
-
p4a's setup.py advertises 3.7, not 3.6.
My attitude is if you don't test it, you aren't really supporting it, so whatever the decision, please ensure the CI tests cover what setup.py
advertises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About this specific issue (the one suggested by @AndreMiras ):
I will (immediately, so we do not miss it), open a new issue, and target with a separate proper PR.
Generally, about the minimum Python version:
kivy/kivy
: We still need to include3.7
even if reached EOL, at least for2.3.0
aspiwheels
still requires3.7
wheels (due to debian buster). Then, I will check out withpiwheels
maintainer, if there's a chance to avoid distributing wheels for debian buster.- Same applies for
kivy/pyobjus
,kivy/pyjnius
andkivy/plyer
, as are quite tied withkivy/kivy
. - For
kivy/python-for-android
,kivy/kivy-ios
andkivy/buildozer
: what are we waiting to set the minimum version to3.8
? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great insight, thanks @misl6
And yeah of course it makes sense to address that in dedicated PR, it caught my attention in this PR, but it's totally out of this scope
Recently, our CI pipeline began failing due to the default Python version provided by
actions/setup-python
being set to3.12
. This issue stems from the removal ofdistutils
in Python3.12
.Changes:
To address the Python 3.12 compatibility issue, this pull request introduces the following changes:
distutils.spawn.find_executable
withshutil.which
for locating executables.distutils.version.LooseVersion
withpackaging.version.version
for version comparisons.build_tools_version_sort_key
andmax_build_tool_version
, in thepythonforandroid.utils
module. These additions not only resolve DRY (Don't Repeat Yourself) violations but also enhance testability.setuptools
instead ofdistutils
.setuptools
dependencyThese changes ensure that our codebase remains compatible with Python 3.12 and eliminates any reliance on deprecated
distutils
functionality.