diff --git a/ChangeLog b/ChangeLog index 2e83567741..e636b65ab8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,10 @@ What's New in astroid 2.6.0? ============================ Release Date: TBA +- A dependency to ``importlib-metadata`` was added for python 3.6 and 3.7. + This is due to the fact that the version is calculated based on tag since 2.5.4. + Closes #1016 What's New in astroid 2.5.8? ============================ diff --git a/astroid/__pkginfo__.py b/astroid/__pkginfo__.py index 9f8b5c17f3..ec7e966de6 100644 --- a/astroid/__pkginfo__.py +++ b/astroid/__pkginfo__.py @@ -26,11 +26,11 @@ """astroid packaging information""" -from pkg_resources import DistributionNotFound, get_distribution +from importlib_metadata import PackageNotFoundError, version try: - __version__ = get_distribution("astroid").version -except DistributionNotFound: - __version__ = "2.5.7+" + __version__ = version("astroid") +except PackageNotFoundError: + __version__ = "2.6.0+" version = __version__ diff --git a/setup.cfg b/setup.cfg index 38621c3503..0ddc44944b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,6 +39,7 @@ install_requires = wrapt>=1.11,<1.13 typed-ast>=1.4.0,<1.5;implementation_name=="cpython" and python_version<"3.8" typing-extensions>=3.7.4;python_version<"3.8" + importlib-metadata>=4.0.0 setup_requires = setuptools_scm python_requires = ~=3.6