mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Add support for Python 3.12
Python 3.12 completely removed the builtin `distutils` module. This commit replaces its use with the `packaging` package, which is an external dependency, but maintained by the Python developers. Signed-off-by: Andrew Gunnerson <accounts+gitlab@chiller3.com>
This commit is contained in:
parent
2fb8fc4879
commit
679ba6f552
5 changed files with 16 additions and 15 deletions
|
|
@ -57,7 +57,7 @@ import defusedxml.ElementTree as XMLElementTree
|
|||
from base64 import urlsafe_b64encode
|
||||
from binascii import hexlify
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from distutils.version import LooseVersion
|
||||
from packaging.version import Version
|
||||
from queue import Queue
|
||||
from zipfile import ZipFile
|
||||
|
||||
|
|
@ -656,7 +656,7 @@ def find_apksigner(config):
|
|||
if not os.path.isdir(os.path.join(build_tools_path, f)):
|
||||
continue
|
||||
try:
|
||||
if LooseVersion(f) < LooseVersion(MINIMUM_APKSIGNER_BUILD_TOOLS_VERSION):
|
||||
if Version(f) < Version(MINIMUM_APKSIGNER_BUILD_TOOLS_VERSION):
|
||||
logging.debug("Local Android SDK only has outdated apksigner versions")
|
||||
return
|
||||
except TypeError:
|
||||
|
|
@ -717,9 +717,9 @@ def test_aapt_version(aapt):
|
|||
# the Debian package has the version string like "v0.2-23.0.2"
|
||||
too_old = False
|
||||
if '.' in bugfix:
|
||||
if LooseVersion(bugfix) < LooseVersion(MINIMUM_AAPT_BUILD_TOOLS_VERSION):
|
||||
if Version(bugfix) < Version(MINIMUM_AAPT_BUILD_TOOLS_VERSION):
|
||||
too_old = True
|
||||
elif LooseVersion('.'.join((major, minor, bugfix))) < LooseVersion('0.2.4062713'):
|
||||
elif Version('.'.join((major, minor, bugfix))) < Version('0.2.4062713'):
|
||||
too_old = True
|
||||
if too_old:
|
||||
logging.warning(_("'{aapt}' is too old, fdroid requires build-tools-{version} or newer!")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue