From df061a687b756a6ea535b61265548dd0697d75ab Mon Sep 17 00:00:00 2001 From: Man Ting Chan Date: Fri, 9 Feb 2024 16:10:45 +0000 Subject: [PATCH] use generated file version --- template/src/{{ package_name }}/__init__.py | 3 +++ template/src/{{ package_name }}/__init__.py.jinja | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-) create mode 100644 template/src/{{ package_name }}/__init__.py delete mode 100644 template/src/{{ package_name }}/__init__.py.jinja diff --git a/template/src/{{ package_name }}/__init__.py b/template/src/{{ package_name }}/__init__.py new file mode 100644 index 00000000..26d23bad --- /dev/null +++ b/template/src/{{ package_name }}/__init__.py @@ -0,0 +1,3 @@ +from ._version import __version__ + +__all__ = ["__version__"] diff --git a/template/src/{{ package_name }}/__init__.py.jinja b/template/src/{{ package_name }}/__init__.py.jinja deleted file mode 100644 index d0766f69..00000000 --- a/template/src/{{ package_name }}/__init__.py.jinja +++ /dev/null @@ -1,11 +0,0 @@ -import sys - -if sys.version_info < (3, 8): - from importlib_metadata import version # noqa -else: - from importlib.metadata import version # noqa - -__version__ = version("{{distribution_name}}") -del version - -__all__ = ["__version__"]