Files
foreignthon-te/src/foreignthon_te/__init__.py
AnishB e34a08a5ba
Some checks failed
Pack Validation CI / validate (pull_request) Has been cancelled
finished beta version
2026-06-13 11:04:21 -05:00

29 lines
914 B
Python

from importlib.resources import files
from importlib.metadata import version, metadata, PackageNotFoundError
try:
package_name = (__package__ or "").replace("_", "-")
__version__ = version(package_name)
pkg_metadata = metadata(package_name)
# 1. Grab names from BOTH possible fields (Author and Author-email)
raw_authors = pkg_metadata.get_all("Author") or []
raw_emails = pkg_metadata.get_all("Author-email") or []
# 2. Combine them into one single, clean list of unique names
combined = []
for item in (raw_authors + raw_emails):
clean_name = item.split("<")[0].strip()
if clean_name and clean_name not in combined:
combined.append(clean_name)
__authors__ = combined
except PackageNotFoundError:
__version__ = "0.0.0"
__authors__ = []
def get_pack_path():
# TODO: Modify this path
return files(__name__) / "template.json"