diff --git a/pyproject.toml b/pyproject.toml index 1e05a50af8..e8868ed92d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "setuptools-scm"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] @@ -36,4 +36,4 @@ ck4inductor = "python/ck4inductor" "ck4inductor.library" = ["src/tensor_operation_instance/gpu/gemm_universal/**/*.hpp", "src/tensor_operation_instance/gpu/gemm_universal_batched/**/*.hpp", "include/ck/library/tensor_operation_instance/gpu/grouped_conv_fwd/**/*.hpp"] [tool.setuptools.dynamic] -version = { attr = "setuptools_scm.get_version" } +version = { attr = "ck4inductor.__version__" } diff --git a/python/ck4inductor/__init__.py b/python/ck4inductor/__init__.py index e69de29bb2..ac44aeb777 100644 --- a/python/ck4inductor/__init__.py +++ b/python/ck4inductor/__init__.py @@ -0,0 +1,19 @@ +def __version__(): + import subprocess + + # needs to be manually updated + rocm_version = "7.0.1" + hash_width = 6 + try: + hash = subprocess.check_output("git rev-parse HEAD", shell=True, text=True)[ + :hash_width + ] + except: + hash = "0" * hash_width + try: + change_count = subprocess.check_output( + f"git rev-list rocm-{rocm_version}..HEAD --count", shell=True, text=True + ).strip() + except: + change_count = "0" + return f"{rocm_version}.dev{change_count}+g{hash}"