Python 3.12 compatibility: distutils removal and setuptools dependency
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 309
- PR merge metrics
- No merged PRs in 30d
Description
The issue:
ccm relies on `distutils` in parts of the codebase, which can break on Python 3.12.
`distutils` is [no longer available](https://docs.python.org/3/whatsnew/3.12.html#distutils) in stdlib on Python 3.12
Additionally, ccm does not declare setuptools as a dependency, so setuptools is not guaranteed to be available, which can lead to failtures.
Proposed direction:
Make sure that `setuptools` is listed as a dependency or replace the functionality provided by the distutils package.
```
Traceback:
../../../../.local/share/uv/python/cpython-3.12.12-macos-aarch64-none/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/integration/test_cluster.py:3: in
from ccm import launch_cassandra_cluster
tests/integration/ccm.py:1: in
import ccmlib.cluster
.venv/lib/python3.12/site-packages/ccmlib/cluster.py:18: in
from ccmlib import common, extension, repository
.venv/lib/python3.12/site-packages/ccmlib/common.py:20: in
from distutils.version import LooseVersion #pylint: disable=import-error, no-name-in-module
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E ModuleNotFoundError: No module named 'distutils'
```
CCM version: `3.1.5`
Python: `cpython-3.12.12`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.