pypa / hatch

Modern, extensible Python project management

Home Page:https://hatch.pypa.io/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hatch version with uv reports dev version

jonathanasdf opened this issue · comments

Steps:

hatch new test_project
cd test-project
git init
git add :
git commit -am "Initial commit."
git tag -m "Initial commit" v0.1.0

Update pyproject.toml

[build-system]
requires = ["hatchling", "hatch-vcs"]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/test_project/_version.py"

At this point, running hatch version gives the correct version, 0.1.0.

Update pyproject.toml

[tool.hatch.envs.default]
installer = "uv"

Now, running hatch version gives an incorrect version, 0.1.1.dev0+g7b5e265.d20240827

Nvm that change causes uncommitted changes in the current dir which is what causes the dev version oops