mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
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`.
12 lines
382 B
Python
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")
|