Summary
The version string is duplicated in two places that can drift apart: pyproject.toml (package metadata) and src/dextrace/version.py (hardcoded, used by the CLI's --version). In the 26.6.1 release these disagree — pip show dextrace reports 26.6.1 while dextrace -V prints DexTrace 25.10.1. A single source of truth avoids this class of bug.
If you want to read the version of a package, the recommended way is importlib.metadata.version("name").
— https://docs.python.org/3/library/importlib.metadata.html#distribution-versions
Root cause
# src/dextrace/version.py
__version__ = "25.10.1"
The bump to 26.6.1 was applied to pyproject.toml but not to this hardcoded literal, so dextrace -V (which reads __version__) shipped the old number.
Fix
# src/dextrace/version.py
from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version("dextrace")
except PackageNotFoundError: # running from source tree without an install
__version__ = "0.0.0+dev"
pyproject.toml becomes the only place a version is declared; the CLI always matches the installed package metadata.
Affected locations
| File |
Line(s) |
Context |
src/dextrace/version.py |
5 |
Hardcoded __version__ literal |
src/dextrace/cli/main.py |
8, 26 |
Imports __version__, uses it for --version |
Summary
The version string is duplicated in two places that can drift apart:
pyproject.toml(package metadata) andsrc/dextrace/version.py(hardcoded, used by the CLI's--version). In the26.6.1release these disagree —pip show dextracereports26.6.1whiledextrace -VprintsDexTrace 25.10.1. A single source of truth avoids this class of bug.Root cause
The bump to
26.6.1was applied topyproject.tomlbut not to this hardcoded literal, sodextrace -V(which reads__version__) shipped the old number.Fix
pyproject.tomlbecomes the only place a version is declared; the CLI always matches the installed package metadata.Affected locations
src/dextrace/version.py__version__literalsrc/dextrace/cli/main.py__version__, uses it for--version