diff --git a/embed_video/__init__.py b/embed_video/__init__.py index 3c6e419..9eb904b 100644 --- a/embed_video/__init__.py +++ b/embed_video/__init__.py @@ -1,3 +1,8 @@ -from pkg_resources import get_distribution +import sys -__version__ = get_distribution("django-embed-video").version +if sys.version_info >= (3, 8): + import importlib.metadata as metadata +else: + import importlib_metadata as metadata + +__version__ = metadata.version("django-embed-video") diff --git a/setup.py b/setup.py index 6223772..0ecd073 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,11 @@ "Topic :: Internet :: WWW/HTTP", ], keywords=["youtube", "vimeo", "video", "soundcloud"], - install_requires=["requests >= 2.19", "Django >= 3.2"], + install_requires=[ + "requests >= 2.19", + "Django >= 3.2", + "importlib-metadata; python_version < '3.8'", + ], setup_requires=["readme", "setuptools_scm"], tests_require=["Django", "requests >= 2.19", "coverage"], )