Package: python3-pytoolconfig
Version: 1.3.1-5
Severity: minor
Tags: upstream

`_version.py` reads the version through `PyToolConfig`, looking for a
`pyproject.toml` starting from the package directory. Once the package
is installed (site-packages, distribution packages) there is no
`pyproject.toml` there, so the version is always reported as
`"UNKNOWN"`. It also means a file search on every import.

test.py:

    import pytoolconfig._version

    print(pytoolconfig._version.version)

Actual: `UNKNOWN`

Expected: `1.3.1`

`importlib.metadata.version("pytoolconfig")` returns the installed
version and does not need any file lookup.

Reproduced with python3-pytoolconfig 1.3.1-5 (code unchanged in 1.3.1-6)
on Python 3.13 and 3.14.

This is an upstream bug, it will be forwarded.


-- System Information:
Debian Release: forky/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 7.2.9+deb14-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE=it
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Reply via email to