Bug#1121935: python3-clang doesn't include a python package version
Kienan
kstewart at efficios.com
Thu Dec 4 21:32:01 GMT 2025
Package: python3-clang
Version: 1:19.0-63
Severity: normal
Dear Maintainer,
python3-clang does not provide a pythong package version that is
introspectable using `importlib.metadata.version`.
For example, with wheel:
$ python3 -c "import importlib.metadata; print(importlib.metadata.version('wheel'))"
0.46.1
With python3-clang:
$ python3 -c "import importlib.metadata; print(importlib.metadata.version('clang'))"
Traceback (most recent call last):
File "/usr/lib/python3.13/importlib/metadata/__init__.py", line 407, in from_name
return next(iter(cls.discover(name=name)))
StopIteration
I ran into this usse while trying to use clang2py[1] with
python3-clang installed via the Debian package. clang2py assumes that
the the version of the clang Python package is in line with the major
version of clang used[2].
I'm not entirely sure the best way to do this. While I think adding
`__version__ = "19.xxx"` to `__init__.py` would work, I don't believe
that this is necessarily the standard approach.
I also note that packages aren't obligated to supply a run-time
queryable version[3].
[1]: https://github.com/trolldbois/ctypeslib
[2]: https://github.com/trolldbois/ctypeslib/blob/master/ctypeslib/__init__.py#L109
[3]: https://packaging.python.org/en/latest/discussions/versioning/#accessing-version-information-at-runtime
-- System Information:
Debian Release: 13.2
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.12.48+deb13-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-clang depends on:
ii python3-clang-19 1:19.1.7-3+b1
python3-clang recommends no packages.
python3-clang suggests no packages.
-- no debconf information
More information about the Pkg-llvm-team
mailing list