From 90913698a0ce65fd03b44229c35cc366ff70f3ab Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 8 Jun 2021 21:36:06 +0200 Subject: [PATCH] Add a hidden dependencie to retrieve version --- ChangeLog | 3 +++ astroid/__pkginfo__.py | 8 ++++---- setup.cfg | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) 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