gemini-code-assist[bot] commented on code in PR #154: URL: https://github.com/apache/tvm-ffi/pull/154#discussion_r2437598067
########## pyproject.toml: ########## @@ -94,10 +95,15 @@ tvm-ffi-config = "tvm_ffi.config:__main__" tvm-ffi-stubgen = "tvm_ffi.stub.stubgen:__main__" [build-system] -requires = ["scikit-build-core>=0.10.0", "cython", "cmake>=3.18", "ninja"] +requires = ["scikit-build-core>=0.10.0", "cython", "setuptools-scm"] build-backend = "scikit_build_core.build" +[tool.setuptools_scm] +version_file = "python/tvm_ffi/_version.py" Review Comment:  The `version_file` key is deprecated in `setuptools_scm` in favor of `write_to`. Since you are using `write_to`, this line is redundant and can be removed. ########## python/tvm_ffi/__init__.py: ########## @@ -60,6 +59,13 @@ # optional module to speedup dlpack conversion from . import _optional_torch_c_dlpack + +try: + from ._version import __version__, __version_tuple__ # type: ignore[import-not-found] +except ImportError: + __version__ = version = "0.0.0.dev0" + __version_tuple__ = version_tuple = (0, 0, 0, "dev0", "7d34eb8ab.d20250913") Review Comment:  The assignments to `version` and `version_tuple` create unused local variables. You can simplify this by assigning directly to `__version__` and `__version_tuple__`. ```suggestion __version__ = "0.0.0.dev0" __version_tuple__ = (0, 0, 0, "dev0", "7d34eb8ab.d20250913") ``` ########## pyproject.toml: ########## @@ -61,6 +61,7 @@ dev = [ "cython", "cmake", "scikit-build-core", + "tomli", Review Comment:  The `tomli` dependency was required by the `check-version` pre-commit hook, which is removed in this pull request. Is this dependency still needed for other development tasks? If not, it can be removed from the `dev` dependency group to keep the dependencies minimal. ########## pyproject.toml: ########## @@ -142,6 +148,7 @@ sdist.include = [ "/python/tvm_ffi/**/*.pyx", "/python/tvm_ffi/**/*.pyi", "/python/tvm_ffi/py.typed", + "/python/tvm_ffi/_version.py", Review Comment:  When using `setuptools_scm` with the `write_to` option, the generated version file is automatically included in the source distribution (sdist). Therefore, explicitly adding `/python/tvm_ffi/_version.py` to `sdist.include` is not necessary and can be removed for a cleaner configuration. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
