diff --git a/.hatch_build.py b/.hatch_build.py index 61f490f603..9c80bf2a76 100644 --- a/.hatch_build.py +++ b/.hatch_build.py @@ -9,8 +9,6 @@ class MetaDataHook(MetadataHookInterface): def update(self, metadata: dict[str, t.Any]) -> None: - about = load_about() - metadata["version"] = about["__package_version__"] metadata["dependencies"] = load_requirements("base.in") metadata["optional-dependencies"] = { "dev": load_requirements("dev.txt"), @@ -18,13 +16,6 @@ def update(self, metadata: dict[str, t.Any]) -> None: } -def load_about() -> dict[str, str]: - about: dict[str, str] = {} - with open(os.path.join(HERE, "tutor", "__about__.py"), "rt", encoding="utf-8") as f: - exec(f.read(), about) # pylint: disable=exec-used - return about - - def load_requirements(filename: str) -> list[str]: requirements = [] with open( diff --git a/changelog.d/20251014_144203_mlabeeb03_remove_hatch_definition.md b/changelog.d/20251014_144203_mlabeeb03_remove_hatch_definition.md new file mode 100644 index 0000000000..6d25fcd337 --- /dev/null +++ b/changelog.d/20251014_144203_mlabeeb03_remove_hatch_definition.md @@ -0,0 +1 @@ +- [Chore] Remove unnecessary hatch definition for version. (by @mlabeeb03) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 71a05dffa1..22ce76078f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,9 @@ Community = "https://discuss.openedx.org/tag/tutor" [tool.hatch.metadata.hooks.custom] path = ".hatch_build.py" +[tool.hatch.version] +path = "tutor/__about__.py" + [build-system] requires = ["hatchling"] build-backend = "hatchling.build"