]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
pybind: hardwire language_level to 3 wip-pr-67045-kefu-3
authorKefu Chai <k.chai@proxmox.com>
Fri, 23 Jan 2026 01:36:22 +0000 (09:36 +0800)
committerKefu Chai <k.chai@proxmox.com>
Tue, 27 Jan 2026 08:09:44 +0000 (16:09 +0800)
commit578b581f4fa3c738107b068a794982af2acd0d2f
treebb11fa869f949b12af27f038f70706c35d590636
parent9241c7f1e822c32504f41b0dd77f91ce5b4d232f
pybind: hardwire language_level to 3

Previously, to maintain backward compatibility with Python 2, we set
'language_level' to sys.version_info.major, so the value would be 2
when building with Python 2, and 3 with Python 3. Now that Python 2
support has been dropped, we can hardwire it to "3".

This change also removes the comment about switching to
`language_level=3str` in the future. According to the Cython 3.1+
documentation,

> language_level=3 is now the default. language_level=3str has become a
> legacy alias.

see https://cython.readthedocs.io/en/3.1.x/src/changes.html.

For context, in Cython < 3.1, language_level=3 and language_level=3str
had different meanings:
- 3 = unprefixed strings are unicode
- 3str = unprefixed strings follow Python version (bytes in Py2, unicode
  in Py3)

Since we no longer support Python 2, this distinction is irrelevant and
the comment can be safely removed.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/pybind/rados/rados.pyx
src/pybind/rados/setup.py
src/pybind/rbd/rbd.pyx
src/pybind/rbd/setup.py
src/pybind/rgw/rgw.pyx
src/pybind/rgw/setup.py