diff --git a/pyproject.toml b/pyproject.toml index 0436f20..5eeb233 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "KaTrain" -dynamic = ["version"] +version = "1.17.0" description = "Go/Baduk/Weiqi playing and teaching app with a variety of AIs" authors = [{ name = "Sander Land" }] requires-python = ">=3.9,<3.13" @@ -52,16 +52,6 @@ include = ["katrain"] [tool.hatch.build.targets.wheel] include = ["katrain"] -[tool.hatch.version] -source = "uv-dynamic-versioning" - -[tool.uv-dynamic-versioning] -fallback-version = "0.0.0" - -[tool.uv-dynamic-versioning.from-file] -source = "katrain/core/constants.py" -pattern = "^VERSION\\s*=\\s*\"(.*)\"" - [build-system] -requires = ["hatchling", "uv-dynamic-versioning"] +requires = ["hatchling"] build-backend = "hatchling.build" diff --git a/tests/test_version.py b/tests/test_version.py new file mode 100644 index 0000000..7f2512f --- /dev/null +++ b/tests/test_version.py @@ -0,0 +1,24 @@ +import tomllib +from pathlib import Path + +from katrain.core.constants import VERSION + + +def test_version_consistency(): + """Test that the version in constants.py matches the version in pyproject.toml""" + # Get the project root directory (parent of tests directory) + project_root = Path(__file__).parent.parent + pyproject_path = project_root / "pyproject.toml" + + # Read the version from pyproject.toml + with open(pyproject_path, "rb") as f: + pyproject_data = tomllib.load(f) + + pyproject_version = pyproject_data["project"]["version"] + + # Compare versions + assert VERSION == pyproject_version, ( + f"Version mismatch: constants.py has '{VERSION}' but " + f"pyproject.toml has '{pyproject_version}'. " + "Please update both files to have the same version." + ) \ No newline at end of file diff --git a/uv.lock b/uv.lock index 20744af..c6f416f 100644 --- a/uv.lock +++ b/uv.lock @@ -262,6 +262,7 @@ wheels = [ [[package]] name = "katrain" +version = "1.17.0" source = { editable = "." } dependencies = [ { name = "chardet" },