PEP-632 deprecated distutils module in Python 3.10, and starting from 3.12 it is not included in standard library any more.
CLI tools used LooseVersion from distutils.version for version number comparisons in number of places and now related imports are broken on Python 3.12 unless distutils is manually installed on the system.
To overcome that issue, use PEP-440 compliant version handling layer from packaging library by PyPA:
from packaging.version import Version
which, for our use-cases, is a drop-in replacement for LooseVersion.
The changes induce backwards-incompatibility in two places for Python API:
Type of codemagic.models.Xcode.version property was changed from distutils.version.LooseVersion to packaging.version.Version.
Type of codemagic.models.simulator.Runtime.runtime_version property was changed from distutils.version.LooseVersion to packaging.version.Version.
Dependencies
No new dependencies are required as packaging was added already in #306.
Description
PEP-632 deprecated
distutils
module in Python 3.10, and starting from 3.12 it is not included in standard library any more.CLI tools used
LooseVersion
fromdistutils.version
for version number comparisons in number of places and now related imports are broken on Python 3.12 unlessdistutils
is manually installed on the system.To overcome that issue, use PEP-440 compliant version handling layer from
packaging
library by PyPA:which, for our use-cases, is a drop-in replacement for
LooseVersion
.The changes induce backwards-incompatibility in two places for Python API:
codemagic.models.Xcode.version
property was changed fromdistutils.version.LooseVersion
topackaging.version.Version
.codemagic.models.simulator.Runtime.runtime_version
property was changed fromdistutils.version.LooseVersion
topackaging.version.Version
.Dependencies
No new dependencies are required as
packaging
was added already in #306.