django-model-utils/model_utils/__init__.py
Maarten ter Huurne 62cecfeb25 Suppress error about __version__ being None when not installed
Suppress rather than annotate, because people type checking against
`django-model-utils` will always have it installed and therefore
should not have to deal with `__version__` being `None`.
2024-04-05 17:15:16 +02:00

12 lines
382 B
Python

import importlib.metadata
from .choices import Choices
from .tracker import FieldTracker, ModelTracker
try:
__version__ = importlib.metadata.version('django-model-utils')
except importlib.metadata.PackageNotFoundError: # pragma: no cover
# package is not installed
__version__ = None # type: ignore[assignment]
__all__ = ("Choices", "FieldTracker", "ModelTracker")