diff --git a/fastapi_restful/__init__.py b/fastapi_restful/__init__.py index 3f97a2b2..2d637b95 100644 --- a/fastapi_restful/__init__.py +++ b/fastapi_restful/__init__.py @@ -1,6 +1,14 @@ +import importlib.metadata + from .cbv_base import Api, Resource, set_responses, take_init_parameters -__version__ = "0.4.3" +try: + __version__ = importlib.metadata.version(__name__) +except Exception as e: + warnings.warn(f"Could not determine version of {__name__}", stacklevel=1) + warnings.warn(str(e), stacklevel=1) + __version__ = "unknown" + __all__ = [ "Api",