We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c032492 commit 8d8e2b9Copy full SHA for 8d8e2b9
setup.py
@@ -13,7 +13,7 @@
13
long_description_content_type="text/x-rst",
14
license="MIT license",
15
python_requires=">=3.7",
16
- requires=["django (>=2.2)"],
+ requires=["django (>=2.2)", "importlib_metadata;python_version<'3.8'"],
17
packages=["widget_tweaks", "widget_tweaks.templatetags"],
18
classifiers=[
19
"Development Status :: 5 - Production/Stable",
widget_tweaks/__init__.py
@@ -1,7 +1,6 @@
1
-from pkg_resources import get_distribution, DistributionNotFound
2
-
3
try:
4
- __version__ = get_distribution("django-widget-tweaks").version
5
-except DistributionNotFound:
6
- # package is not installed
7
- __version__ = None
+ from importlib.metadata import version
+except ImportError:
+ from importlib_metadata import version
+
+__version__ = version("django-widget-tweaks")
0 commit comments