diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-04-04 14:37:19 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-04-05 15:08:27 +0200 |
commit | 29bc551a9403e1720e27a705ddbc2ef1d3742388 (patch) | |
tree | 8bf98071b1d8c45c080f9551a3b59a481208177f | |
parent | 95b20ce7cc9ed89a8dbd3be848491d6ca70abae1 (diff) | |
download | pylint-git-29bc551a9403e1720e27a705ddbc2ef1d3742388.tar.gz |
Move informations that never change in the setup.py
-rw-r--r-- | .github/workflows/ci.yaml | 9 | ||||
-rw-r--r-- | doc/conf.py | 4 | ||||
-rw-r--r-- | doc/release.md | 4 | ||||
-rw-r--r-- | pylint/__init__.py | 2 | ||||
-rw-r--r-- | pylint/__pkginfo__.py | 62 | ||||
-rw-r--r-- | pylint/constants.py | 4 | ||||
-rw-r--r-- | setup.py | 90 |
7 files changed, 74 insertions, 101 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ab8473c17..aa4684ced 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,8 @@ jobs: id: generate-python-key run: >- echo "::set-output name=key::base-venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('pylint/__pkg_info__.py', 'requirements_test.txt', 'requirements_test_min.txt') }}" + hashFiles('pylint/__pkg_info__.py', 'requirements_test.txt', 'setup.py', 'requirements_test_min.txt') + }}" - name: Restore Python virtual environment id: cache-venv uses: actions/cache@v2.1.4 @@ -161,7 +162,7 @@ jobs: id: generate-python-key run: >- echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('pylint/__pkg_info__.py', 'requirements_test.txt', + hashFiles('pylint/__pkg_info__.py', 'requirements_test.txt', 'setup.py', 'requirements_test_min.txt') }}" - name: Restore Python virtual environment id: cache-venv @@ -333,7 +334,7 @@ jobs: id: generate-python-key run: >- echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('pylint/__pkg_info__.py', 'requirements_test_min.txt') }}" + hashFiles('pylint/__pkg_info__.py', 'setup.py', 'requirements_test_min.txt') }}" - name: Restore Python virtual environment id: cache-venv uses: actions/cache@v2.1.4 @@ -411,7 +412,7 @@ jobs: id: generate-python-key run: >- echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{ - hashFiles('pylint/__pkg_info__.py', 'requirements_test_min.txt') }}" + hashFiles('pylint/__pkg_info__.py', 'setup.py', 'requirements_test_min.txt') }}" - name: Restore Python virtual environment id: cache-venv uses: actions/cache@v2.1.4 diff --git a/doc/conf.py b/doc/conf.py index a727c75e3..d76cc67e3 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -19,7 +19,7 @@ from datetime import datetime # built documents. # # The short X.Y version. -from pylint.__pkginfo__ import version +from pylint import __version__ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -58,7 +58,7 @@ current_year = datetime.utcnow().year copyright = f"2003-{current_year}, Logilab, PyCQA and contributors" # The full version, including alpha/beta/rc tags. -release = version +release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/release.md b/doc/release.md index d55f9c0b8..ed4346713 100644 --- a/doc/release.md +++ b/doc/release.md @@ -8,7 +8,7 @@ So, you want to release the ``X.Y.Z`` version of pylint ? 0. Run the acceptance tests to see if everything is alright with this release. We don't run them on CI: ``pytest -m acceptance`` 1. Check if the dependencies of the package are correct - 2. Update ``numversion`` in ``__pkginfo__``, ``dev_version`` should be ``None`` when you tag, + 2. Update ``__version__`` in ``pylint/__pkginfo__.py``, ``dev_version`` should be ``None`` when you tag, except if it's an alpha release. 3. Put the version numbers, and the release date into the changelog 4. Put the release date into the ``What's new`` section. @@ -88,6 +88,6 @@ Take a look at the examples from ``doc/whatsnew``. ### Versions -Update ``numversion`` to ``X.Y+1.0`` in ``__pkginfo__`` for ``master`` and to +Update ``__version__`` to ``X.Y+1.0`` in ``pylint/__pkginfo__.py`` for ``master`` and to ``X.Y.Z+1`` for the ``X.Y`` branch. ``dev_version`` should also be back to an integer after the tag. diff --git a/pylint/__init__.py b/pylint/__init__.py index 2779c67c7..e33904356 100644 --- a/pylint/__init__.py +++ b/pylint/__init__.py @@ -12,7 +12,7 @@ import os import sys -from pylint.__pkginfo__ import version as __version__ +from pylint.__pkginfo__ import __version__ # pylint: disable=import-outside-toplevel diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index d76047e0d..ebb2c295f 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -1,71 +1,17 @@ -# Copyright (c) 2006-2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr> -# Copyright (c) 2013-2014 Google, Inc. -# Copyright (c) 2014-2020 Claudiu Popa <pcmanticore@gmail.com> -# Copyright (c) 2014 Brett Cannon <brett@python.org> -# Copyright (c) 2014 Ricardo Gemignani <ricardo.gemignani@gmail.com> -# Copyright (c) 2014 Arun Persaud <arun@nubati.net> -# Copyright (c) 2015 Ionel Cristian Maries <contact@ionelmc.ro> -# Copyright (c) 2016 Moises Lopez <moylop260@vauxoo.com> -# Copyright (c) 2016 Florian Bruhin <git@the-compiler.org> -# Copyright (c) 2016 Jakub Wilk <jwilk@jwilk.net> -# Copyright (c) 2017-2018 Hugo <hugovk@users.noreply.github.com> -# Copyright (c) 2018-2020 Ashley Whetter <ashley@awhetter.co.uk> -# Copyright (c) 2018 ssolanki <sushobhitsolanki@gmail.com> -# Copyright (c) 2018 Sushobhit <31987769+sushobhit27@users.noreply.github.com> -# Copyright (c) 2019-2020 Ville Skyttä <ville.skytta@iki.fi> -# Copyright (c) 2019 Hugo van Kemenade <hugovk@users.noreply.github.com> -# Copyright (c) 2019 Dan Hemberger <846186+hemberger@users.noreply.github.com> -# Copyright (c) 2019 jab <jab@users.noreply.github.com> -# Copyright (c) 2020-2021 Pierre Sassoulas <pierre.sassoulas@gmail.com> -# Copyright (c) 2020 hippo91 <guillaume.peillex@gmail.com> -# Copyright (c) 2020 Damien Baty <damien.baty@polyconseil.fr> -# Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com> - # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING from typing import Optional -version = "2.8.0" +__version__ = "2.8.0" # 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] = 1 if dev_version is not None: if alpha_version: - version += f"a{dev_version}" + __version__ += f"a{dev_version}" else: - version += f"-dev{dev_version}" + __version__ += f"-dev{dev_version}" -install_requires = [ - "astroid>=2.5.2,<2.7", - "isort>=4.2.5,<6", - "mccabe>=0.6,<0.7", - "toml>=0.7.1", -] -license = "GPL-2.0-or-later" # pylint: disable=redefined-builtin -description = "python code static checker" -web = "https://github.com/PyCQA/pylint" -mailinglist = "mailto:code-quality@python.org" -project_urls = {"What's New": "https://pylint.pycqa.org/en/latest/whatsnew/"} -author = "Python Code Quality Authority" -author_email = "code-quality@python.org" -classifiers = [ - "Development Status :: 6 - Mature", - "Environment :: Console", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU General Public License (GPL)", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Software Development :: Debuggers", - "Topic :: Software Development :: Quality Assurance", - "Topic :: Software Development :: Testing", -] +mailing_list = ("mailto:code-quality@python.org",) diff --git a/pylint/constants.py b/pylint/constants.py index 2124a2020..805d565b8 100644 --- a/pylint/constants.py +++ b/pylint/constants.py @@ -5,7 +5,7 @@ import sys import astroid -from pylint.__pkginfo__ import version as pylint_version +from pylint.__pkginfo__ import __version__ PY38_PLUS = sys.version_info[:2] >= (3, 8) PY39_PLUS = sys.version_info[:2] >= (3, 9) @@ -45,6 +45,6 @@ class WarningScope: NODE = "node-based-msg" -full_version = f"""pylint {pylint_version} +full_version = f"""pylint {__version__} astroid {astroid.__version__} Python {sys.version}""" @@ -31,35 +31,61 @@ for requirement_file in DEV_REQUIREMENTS_FILES: ] -setuptools.setup( - name="pylint", - version=__pkginfo__["version"], - license=__pkginfo__["license"], - description=__pkginfo__["description"], - long_description=long_description, - author=__pkginfo__["author"], - author_email=__pkginfo__["author_email"], - url=__pkginfo__["web"], - project_urls=__pkginfo__.get("project_urls", {}), - classifiers=__pkginfo__["classifiers"], - data_files=__pkginfo__.get("data_files", None), - ext_modules=__pkginfo__.get("ext_modules", None), - python_requires="~=3.6", - setup_requires=[], - tests_require=["pytest", "pytest-benchmark"], - install_requires=__pkginfo__.get("install_requires", None), - extras_require={ - ':sys_platform=="win32"': ["colorama"], - "docs": doc_extra_requires, - "dev": dev_extra_requires, - }, - entry_points={ - "console_scripts": [ - "pylint = pylint:run_pylint", - "epylint = pylint:run_epylint", - "pyreverse = pylint:run_pyreverse", - "symilar = pylint:run_symilar", - ] - }, - packages=setuptools.find_packages(), -) +def install(): + setuptools.setup( + name="pylint", + version=__pkginfo__["__version__"], + license="GPL-2.0-or-later", + description="python code static checker", + long_description=long_description, + author="Python Code Quality Authority", + author_email="code-quality@python.org", + url="https://github.com/PyCQA/pylint", + project_urls={"What's New": "https://pylint.pycqa.org/en/latest/whatsnew/"}, + classifiers=[ + "Development Status :: 6 - Mature", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License (GPL)", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development :: Debuggers", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", + ], + packages=setuptools.find_packages(), + python_requires="~=3.6", + setup_requires=[], + tests_require=test_requires, + install_requires=[ + "astroid>=2.5.2,<2.7", + "isort>=4.2.5,<6", + "mccabe>=0.6,<0.7", + "toml>=0.7.1", + ], + extras_require={ + ':sys_platform=="win32"': ["colorama"], + "docs": doc_extra_requires, + "dev": dev_extra_requires, + }, + entry_points={ + "console_scripts": [ + "pylint = pylint:run_pylint", + "epylint = pylint:run_epylint", + "pyreverse = pylint:run_pyreverse", + "symilar = pylint:run_symilar", + ] + }, + ) + + +if __name__ == "__main__": + install() |