tutor-discovery/.hatch_build.py
Muhammad Labeeb 18d1825de7
feat: migrate from pylint/black to ruff (#104)
* feat: migrate from pylint/black to ruff

* test: verify python package distribution build when running make test
2025-08-28 18:59:56 +05:00

23 lines
608 B
Python

# 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, "tutordiscovery", "__about__.py"), "rt", encoding="utf-8"
) as f:
exec(f.read(), about)
return about