From 5c557adb6bd8184c51f438202c587be7c240e6eb Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 5 Mar 2026 09:59:28 +0100 Subject: [PATCH] Proper initialization for `__version__` Also, AppVeyor is not used any more, is it? --- tabulate/__init__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tabulate/__init__.py b/tabulate/__init__.py index 249b3ff..2876fda 100644 --- a/tabulate/__init__.py +++ b/tabulate/__init__.py @@ -8,7 +8,10 @@ try: __version__ = _version("tabulate") except _PackageNotFoundError: - __version__ = "unknown" + try: + from .version import version as __version__ # noqa: F401 + except ImportError: + __version__ = "unknown" import warnings from collections import namedtuple @@ -35,11 +38,6 @@ def _is_file(f): __all__ = ["tabulate", "tabulate_formats", "simple_separated_format"] -try: - from .version import version as __version__ # noqa: F401 -except ImportError: - pass # running __init__.py as a script, AppVeyor pytests - # minimum extra space in headers MIN_PADDING = 2