diff --git a/codeflash/telemetry/posthog_cf.py b/codeflash/telemetry/posthog_cf.py index a90ef16c9..9bb219d48 100644 --- a/codeflash/telemetry/posthog_cf.py +++ b/codeflash/telemetry/posthog_cf.py @@ -7,7 +7,7 @@ from codeflash.api.cfapi import get_user_id from codeflash.cli_cmds.console import logger -from codeflash.version import __version__, __version_tuple__ +from codeflash.version import __version__ _posthog = None @@ -36,7 +36,7 @@ def ph(event: str, properties: dict[str, Any] | None = None) -> None: return properties = properties or {} - properties.update({"cli_version": __version__, "cli_version_tuple": __version_tuple__}) + properties.update({"cli_version": __version__}) user_id = get_user_id() diff --git a/codeflash/update_license_version.py b/codeflash/update_license_version.py index 3deff1e69..283151dad 100644 --- a/codeflash/update_license_version.py +++ b/codeflash/update_license_version.py @@ -2,15 +2,15 @@ from datetime import datetime from pathlib import Path -from version import __version_tuple__ +from .version import __version__ def main() -> None: # Use the version tuple from version.py - version = __version_tuple__ + version = __version__ # Use the major and minor version components from the version tuple - major_minor_version = ".".join(map(str, version[:2])) + major_minor_version = ".".join(map(str, version.split(".")[:2])) # Define the pattern to search for and the replacement string for the version version_pattern = re.compile(r"(Licensed Work:\s+Codeflash Client version\s+)(0\.\d+)(\.x)") diff --git a/codeflash/version.py b/codeflash/version.py index cb4d9470e..18e1bae9c 100644 --- a/codeflash/version.py +++ b/codeflash/version.py @@ -1,3 +1,2 @@ # These version placeholders will be replaced by uv-dynamic-versioning during build. -__version__ = "0.14.6" -__version_tuple__ = (0, 14, 6) +__version__ = "0.14.7" diff --git a/pyproject.toml b/pyproject.toml index 8ae24fbe4..bcac6575a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -268,17 +268,17 @@ enable = true style = "pep440" vcs = "git" -[tool.uv-dynamic-versioning.substitution] -files = ["codeflash/version.py"] - -[tool.uv-dynamic-versioning.files."codeflash/version.py"] -persistent-substitution = true -initial-content = """ - # These version placeholders will be replaced by uv-dynamic-versioning during build. - __version__ = "0.0.0" - __version_tuple__ = (0, 0, 0) +[tool.hatch.build.hooks.version] +path = "codeflash/version.py" +template = """# These version placeholders will be replaced by uv-dynamic-versioning during build. +__version__ = "{version}" """ + +#[tool.hatch.build.hooks.custom] +#path = "codeflash/update_license_version.py" + + [tool.codeflash] module-root = "codeflash" tests-root = "tests"