[libclang/python] Renaming get_version into get_clang_version (#188515)

Rename `get_version` to `get_clang_version` to match the `libclang.so`
name[1], and be clear we doesn't return some `cindex.py` internal
versioning but the `libclang.so` one.

[1] This match was some current API are doing for example
`conf.lib.clang_getArraySize` is mapped to `get_array_size`.
This commit is contained in:
Thomas Applencourt 2026-03-26 22:47:00 -05:00 committed by GitHub
parent f9acb06ce4
commit add5b811ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -4650,7 +4650,7 @@ class Config:
return library
def get_version(self):
def get_clang_version(self) -> str:
"""
Returns the libclang version string used by the bindings
"""

View File

@ -6,6 +6,6 @@ from clang.cindex import Config
class TestClangVersion(unittest.TestCase):
def test_get_version_format(self):
conf = Config()
version = conf.get_version()
version = conf.get_clang_version()
self.assertRegex(version, r"^clang version \d+\.\d+\.\d+")

View File

@ -580,8 +580,8 @@ Python Binding Changes
``CodeCompletionResults.results`` should be changed to directly use
``CodeCompletionResults``: it nows supports ``__len__`` and ``__getitem__``,
so it can be used the same as ``CodeCompletionResults.results``.
- Added a new helper method ``get_version`` to the class ``Config`` to read the
version string of the libclang in use.
- Added a new helper method ``get_clang_version`` to the class ``Config`` to
read the version string of the libclang in use.
OpenMP Support
--------------