From 6a36cbf49d61ff9874bdf8f8d8c01782e920ffaa Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Sat, 12 Dec 2020 21:27:34 -0500 Subject: [PATCH] Add a __version__ attribute to the top-level package --- composed_configuration/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/composed_configuration/__init__.py b/composed_configuration/__init__.py index 78575c3..cc5b82e 100644 --- a/composed_configuration/__init__.py +++ b/composed_configuration/__init__.py @@ -1,3 +1,5 @@ +from importlib.metadata import PackageNotFoundError, version + from ._allauth import AllauthMixin from ._base import ComposedConfiguration, ConfigMixin from ._celery import CeleryMixin @@ -47,3 +49,9 @@ 'TestingBaseConfiguration', 'WhitenoiseStaticFileMixin', ] + +try: + __version__ = version('django-composed-configuration') +except PackageNotFoundError: + # package is not installed + pass