diff --git a/.hatch_build.py b/.hatch_build.py deleted file mode 100644 index 627375b..0000000 --- a/.hatch_build.py +++ /dev/null @@ -1,22 +0,0 @@ -# https://hatch.pypa.io/latest/how-to/config/dynamic-metadata/ -import os -import typing as t - -from hatchling.metadata.plugin.interface import MetadataHookInterface - -HERE = os.path.dirname(__file__) - - -class MetaDataHook(MetadataHookInterface): - def update(self, metadata: dict[str, t.Any]) -> None: - about = load_about() - metadata["version"] = about["__version__"] - - -def load_about() -> dict[str, str]: - about: dict[str, str] = {} - with open( - os.path.join(HERE, "tutorandroid", "__about__.py"), "rt", encoding="utf-8" - ) as f: - exec(f.read(), about) - return about diff --git a/changelog.d/20260127_133216_abdul.muqadim_remove_hatch_def.md b/changelog.d/20260127_133216_abdul.muqadim_remove_hatch_def.md new file mode 100644 index 0000000..054111a --- /dev/null +++ b/changelog.d/20260127_133216_abdul.muqadim_remove_hatch_def.md @@ -0,0 +1 @@ +- [chore] Remove unnecessary hatch definition for version. (by @Abdul-Muqadim-Arbisoft) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index aaa2c3b..71214dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,9 +49,8 @@ Code = "https://github.com/overhangio/tutor-android" Issues = "https://github.com/overhangio/tutor-android/issues" Community = "https://discuss.openedx.org/tag/tutor" -# Hatch-specific configuration -[tool.hatch.metadata.hooks.custom] -path = ".hatch_build.py" +[tool.hatch.version] +path = "tutorandroid/__about__.py" [build-system] requires = ["hatchling"] @@ -60,7 +59,7 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.sdist] # Disable strict naming for twine compatibility strict-naming = false -include = [ "/tutorandroid", '.hatch_build.py' ] +include = [ "/tutorandroid"] exclude = [ "tests*" ] [tool.hatch.build.targets.wheel]