docs(conf): replace pkg_resources with importlib

The doc is build with python 3.8, which includes the `importlib` API to
get the package version. Its use is recommended by `setuptools-scm` for
the doc.
This commit is contained in:
François Magimel 2022-01-19 11:16:42 +01:00 committed by Alieh Rymašeŭski
parent 57ddb9693a
commit 645bb83c59

View file

@ -9,8 +9,7 @@
import os
import sys
from datetime import date
from pkg_resources import get_distribution
from importlib.metadata import version
# -- Path setup --------------------------------------------------------------
@ -33,7 +32,7 @@ project = "django-auditlog"
author = "Jan-Jelle Kester and contributors"
copyright = f"2013-{date.today().year}, {author}"
release = get_distribution("django-auditlog").version
release = version("django-auditlog")
# for example take major/minor
version = ".".join(release.split(".")[:2])