tutor-discovery/.hatch_build.py
Muhammad Faraz Maqsood 5c4daa9318
feat: migrate from setup.py/setuptools to pyproject.toml/hatch (#99)
* feat: migrate to pyproject.toml and hatch

* migrate from setup.py/setuptools to pyproject.toml/hatch.

* add optional dependencies

* fix license and author

* update maintainer name

---------

Co-authored-by: Muhammad Faraz  Maqsood <faraz.maqsood@192.168.10.35>
Co-authored-by: Muhammad Labeeb <mlabeeb03@gmail.com>
2025-03-02 14:14:48 +05:00

23 lines
637 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) # pylint: disable=exec-used
return about