fix version (#765)
This commit is contained in:
1 parent
3c78eee34e
commit
97f4075edb
3 files changed
+27
-12
No files matched your search
+2
-12
@@ -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"
|
||||
@@ -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."
|
||||
)
|
||||
Reference in new issue
Block a user