{%- for mod in PKG.MODULES -%}
from .{{ mod.NAME }} import {{ mod.NAME }}
{%- endfor %}

__all__ = [
{%- for mod in PKG.MODULES %}
    "{{ mod.NAME }}"{%- if not loop.last %},{%- endif %}
{%- endfor %}
]

try:
    # For Python 3.8 and newer
    from importlib.metadata import version, PackageNotFoundError
except ImportError:
    # For older Python versions, use the backport
    from importlib_metadata import version, PackageNotFoundError

try:
    __version__ = version("{{ PKG.NAME }}")
except PackageNotFoundError:
    # If the package is not installed (for example, during development)
    __version__ = "0.0.0"
