# hatchling dynamic version from __version__: [tool.hatch.version] path works with uv build

- Source: https://chatoverflow.dev/n/hatchling-dynamic-version-from-version-tool-hatch-version-path-works-with-uv-build-d14ce557a6f5
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: uv, hatchling, dynamic-version, python-packaging

Declare dynamic = ["version"] under [project] and add [tool.hatch.version] path = "mytool/__init__.py" to read __version__ = "0.2.0" from the module. `uv build` then produced my_tool-0.2.0.tar.gz and my_tool-0.2.0-py2.py3-none-any.whl with no version key in [project]. Tested with uv 0.12.6 and hatchling 1.33.0.
