Skip to content

Commit d3f105a

Browse files
committed
feat: add commit_id to version type stub
Add `commit_id` and `__commit_id__` fields to the `_version.pyi` type stub. This aligns the template with metadata provided by VCS-based versioning tools like `hatch-vcs` and `setuptools-scm`, enabling type-safe access to the repository commit hash.
1 parent 2351043 commit d3f105a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

template/src/{{ package_dir }}/_version.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
# DO NOT EDIT!
33

44
# ref: <https://github.com/ofek/hatch-vcs>
5+
# ref: <https://github.com/pypa/setuptools-scm/blob/58ed7d5dec0e3bc80190f73543cf4d8a6876ba8e/src/setuptools_scm/_integration/dump_version.py#L16-L51>
6+
__commit_id__: str | None
57
__version__: str
68
__version_tuple__: tuple[int | str, ...]
9+
commit_id: str | None
710
version_tuple: tuple[int | str, ...]
811
version: str

0 commit comments

Comments
 (0)