From 76a232e0cd3abb0f2d395cd2fe035046daef80fb Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 25 Apr 2021 10:08:58 +0200 Subject: [PATCH] Add scm_setuptools for packaging --- pylint/__pkginfo__.py | 17 +++++------------ setup.cfg | 2 ++ setup.py | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index dfc825fc9d..8316089ec9 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -1,19 +1,12 @@ # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/LICENSE -from typing import Optional - -__version__ = "2.8.1" -# For an official release, use 'alpha_version = False' and 'dev_version = None' -alpha_version: bool = False # Release will be an alpha version if True (ex: '1.2.3a6') -dev_version: Optional[int] = None - -if dev_version is not None: - if alpha_version: - __version__ += f"a{dev_version}" - else: - __version__ += f".dev{dev_version}" +from pkg_resources import DistributionNotFound, get_distribution +try: + __version__ = get_distribution("pylint").version +except DistributionNotFound: + __version__ = "2.8.2+" # Kept for compatibility reason, see https://github.com/PyCQA/pylint/issues/4399 numversion = tuple(__version__.split(".")) diff --git a/setup.cfg b/setup.cfg index 70bc18f1cb..d7f5d5e219 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,6 +46,8 @@ install_requires = mccabe>=0.6,<0.7 toml>=0.7.1 colorama;sys_platform=="win32" +setup_requires = + setuptools_scm python_requires = ~=3.6 [options.packages.find] diff --git a/setup.py b/setup.py index 606849326a..d5d43d7c93 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,3 @@ from setuptools import setup -setup() +setup(use_scm_version=True)