]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
pybind: switch from pkgutil.find_loader() to importlib.util.find_spec() 62879/head
authorKefu Chai <tchaikov@gmail.com>
Fri, 18 Apr 2025 09:24:58 +0000 (17:24 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sat, 19 Apr 2025 01:03:37 +0000 (09:03 +0800)
commit1f79187a1f9e56804616c0c8c01455c0b0dceb99
tree778ec3c4337d21dd41670148c1eff4435d1ee2b4
parenteb3d949d5f67a788dc24b449150a67a93e584ee0
pybind: switch from pkgutil.find_loader() to importlib.util.find_spec()

Replace pkgutil.find_loader() with importlib.util.find_spec() throughout
Python bindings. This addresses the deprecation warning in Python 3.10
(scheduled for removal in 3.14) that appeared when generating librbd
Python bindings.

The importlib.util.find_spec() API has been available since Python 3.4
and is compatible with our minimum required Python version (3.9, since
commit 51f71fc1).

The warning resolved:
```
/home/kefu/dev/ceph/src/pybind/rbd/setup.py:8: DeprecationWarning: 'pkgutil.find_loader' is deprecated and slated for removal in Python 3.14; use importlib.util.find_spec() instead
  if not pkgutil.find_loader('setuptools'):
```

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/pybind/cephfs/setup.py
src/pybind/rados/setup.py
src/pybind/rbd/setup.py
src/pybind/rgw/setup.py