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

Use parse from packaging.version instead of distutils LooseVersion #1812

Merged
merged 2 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from time import sleep
import traceback

from distutils.version import LooseVersion
import packaging
import pexpect

import buildozer.buildops as buildops
Expand Down Expand Up @@ -1306,7 +1306,9 @@ def build_package(self):
pass

build_tools_versions = os.listdir(join(self.android_sdk_dir, "build-tools"))
build_tools_versions = sorted(build_tools_versions, key=LooseVersion)
build_tools_versions = sorted(
build_tools_versions, key=packaging.version.parse
)
build_tools_version = build_tools_versions[-1]
gradle_files = ["build.gradle", "gradle", "gradlew"]
is_gradle_build = build_tools_version >= "25.0" and any(
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def find_version(*file_paths):
include_package_data=True,
install_requires=[
'pexpect',
'packaging',
# Cython is required by both kivy-ios and python-for-android.
# However, python-for-android does not include it in its dependencies
# and kivy-ios's dependencies are not always checked, so it is included
Expand Down
Loading