Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging cleanup, migration to full setuptools without distutils #4294

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
492039d
Upgrade setup.py: move from distutil to setuptools
Pierre-Sassoulas Apr 4, 2021
79986bf
Remove duplication in doc dependencies
Pierre-Sassoulas Apr 4, 2021
1c6fc67
Add a dev extra require
Pierre-Sassoulas Apr 4, 2021
33b83d9
Move informations that never change in the setup.py
Pierre-Sassoulas Apr 4, 2021
0082892
Fix setuptools warning:Normalizing '2.8.0-dev1' to '2.8.0.dev1'
Pierre-Sassoulas Apr 4, 2021
91e8216
Do not include script in the packaging
Pierre-Sassoulas Apr 4, 2021
b6f6be0
Do not include examples in the packaging
Pierre-Sassoulas Apr 4, 2021
7d0dbff
Do not include tests/.benchmark in the packaging
Pierre-Sassoulas Apr 4, 2021
850657b
Include all file in the doc/ in the packaging
Pierre-Sassoulas Apr 4, 2021
a298255
Properly include requirement.txt file in the package
Pierre-Sassoulas Apr 4, 2021
2aec00c
Import cleanup in setup.py
Pierre-Sassoulas Apr 4, 2021
949d667
Use setup.cfg for existing hard coded values
Pierre-Sassoulas Apr 4, 2021
5600bab
Use setup.cfg for readme and licensing
Pierre-Sassoulas Apr 4, 2021
f4ac490
Astroid is pinned to a specific dependencie for tests
Pierre-Sassoulas Apr 4, 2021
4ed481c
Remove extra-require from the packaging
Pierre-Sassoulas Apr 5, 2021
5cb12e1
Quote around projects urls
Pierre-Sassoulas Apr 4, 2021
9897c3f
Handle the version in setup.cfg (as well as everything else)
Pierre-Sassoulas Apr 4, 2021
a9c618a
Put mailing list in the setup.cfg too
Pierre-Sassoulas Apr 4, 2021
652fd64
Package find restricted to pylint in setup.cfg
Pierre-Sassoulas Apr 4, 2021
29a18c0
Formatting : Spaces in project urls in setup.cfg
Pierre-Sassoulas Apr 4, 2021
b785a72
Exclude everything from the final packaging
Pierre-Sassoulas Apr 4, 2021
637c746
Fix test failing if setup.py is not a launchable script
Pierre-Sassoulas Apr 4, 2021
62463ce
Remove pytest.ini in favor of setup.cfg
Pierre-Sassoulas Apr 4, 2021
569a016
Remove .isort.cfg in favor of setup.cfg
Pierre-Sassoulas Apr 4, 2021
250ee6a
Add setup-cfg-fmt in pre-commit configuration
Pierre-Sassoulas Apr 4, 2021
55b7e27
Update travis job as easy_install is not used anymore
Pierre-Sassoulas Apr 4, 2021
b527517
Add discord server in project url
Pierre-Sassoulas Apr 5, 2021
22ce7e6
Autoformat tox.ini after failing to move it to setup.cfg
Pierre-Sassoulas Apr 5, 2021
4101865
Update Changelog following migration to setuptools
Pierre-Sassoulas Apr 5, 2021
e4c5fc2
Remove setup.py from the hashed files
Pierre-Sassoulas Apr 5, 2021
faa4054
Pin astroid precisely in test requirements
Pierre-Sassoulas Apr 5, 2021
d135ca7
Remove Manifest.in as setup.cfg works after removing cache
Pierre-Sassoulas Apr 5, 2021
95994e5
Remove 'deprecated' option zip_safe from setup.cfg
Pierre-Sassoulas Apr 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt')
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.4
Expand Down Expand Up @@ -161,8 +162,8 @@ jobs:
id: generate-python-key
run: >-
echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{
hashFiles('pylint/__pkg_info__.py', 'requirements_test.txt',
'requirements_test_min.txt') }}"
hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt')
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.4
Expand Down Expand Up @@ -333,7 +334,8 @@ 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('setup.cfg', 'requirements_test_min.txt')
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.4
Expand Down Expand Up @@ -411,7 +413,8 @@ 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('setup.cfg', 'requirements_test_min.txt')
}}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v2.1.4
Expand Down
7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ repos:
exclude: "tests/functional/t/trailing_whitespaces.py"
- id: end-of-file-fixer
exclude: "tests/functional/m/missing/missing_final_newline.py|tests/functional/t/trailing_newlines.py"
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.17.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
Expand Down
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ before_install:
- uname -a
- lsb_release -a
install:
# Temporary escape hatch for setuptools 50.0:
# See https://github.com/pypa/setuptools/blob/17cb9d6bf249cefe653d3bdb712582409035a7db/CHANGES.rst#v5000
- export SETUPTOOLS_USE_DISTUTILS=stdlib
- pip install -U setuptools
- pip install tox
- virtualenv --version
- easy_install --version
- pip --version
- tox --version
script:
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Release date: Undefined
* Apply ``const-naming-style`` to module constants annotated with
``typing.Final``

* The packaging is now done via setuptools exclusively. ``doc``, ``test``, ``man``, ``elisp`` and ``Changelog`` are
not packaged anymore - reducing the size of the package by 75%. Debian packaging is now (officially) done in
https://salsa.debian.org/python-team/packages/pylint. The 'doc' extra-require has been removed. ``__pkginfo__`` now
only contain ``__version__`` (also accessible with ``pylint.__version__``), other meta-information are still
accessible with ``import importlib;metadata.metadata('pylint')``.


What's New in Pylint 2.7.5?
===========================
Expand Down
11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

4 changes: 0 additions & 4 deletions bin/epylint

This file was deleted.

5 changes: 0 additions & 5 deletions bin/epylint.bat

This file was deleted.

5 changes: 0 additions & 5 deletions bin/pylint

This file was deleted.

5 changes: 0 additions & 5 deletions bin/pylint.bat

This file was deleted.

4 changes: 0 additions & 4 deletions bin/pyreverse

This file was deleted.

5 changes: 0 additions & 5 deletions bin/pyreverse.bat

This file was deleted.

4 changes: 0 additions & 4 deletions bin/symilar

This file was deleted.

5 changes: 0 additions & 5 deletions bin/symilar.bat

This file was deleted.

4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 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
Expand Down Expand Up @@ -58,7 +58,7 @@
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.
Expand Down
4 changes: 2 additions & 2 deletions doc/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion pylint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
79 changes: 3 additions & 76 deletions pylint/__pkginfo__.py
Original file line number Diff line number Diff line change
@@ -1,88 +1,15 @@
# 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

# pylint: disable=redefined-builtin,invalid-name
"""pylint packaging information"""


from os.path import join
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}"

install_requires = [
"astroid>=2.5.2,<2.7",
"isort>=4.2.5,<6",
"mccabe>=0.6,<0.7",
"toml>=0.7.1",
]

dependency_links = [] # type: ignore

extras_require = {}
extras_require[':sys_platform=="win32"'] = ["colorama"]
extras_require["docs"] = ["sphinx==3.5.1", "python-docs-theme==2020.12"]

license = "GPL-2.0-or-later"
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",
]

scripts = [
join("bin", filename) for filename in ("pylint", "symilar", "epylint", "pyreverse")
]
__version__ += f".dev{dev_version}"
4 changes: 2 additions & 2 deletions pylint/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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)
Expand Down Expand Up @@ -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}"""
6 changes: 0 additions & 6 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion requirements_test_min.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
astroid==2.5.2
Pierre-Sassoulas marked this conversation as resolved.
Show resolved Hide resolved
astroid==2.5.2 # Pinned to a specific version for tests
pytest~=6.2
pytest-benchmark~=3.2
75 changes: 75 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,80 @@
[metadata]
name = pylint
version = attr: pylint.__version__
description = python code static checker
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://github.com/PyCQA/pylint
author = Python Code Quality Authority
author_email = code-quality@python.org
license = GPL-2.0-or-later
license_files =
COPYING
CONTRIBUTORS.txt
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 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Software Development :: Debuggers
Topic :: Software Development :: Quality Assurance
Topic :: Software Development :: Testing
keywords = static code analysis linter python lint
project_urls =
"What's New" = https://pylint.pycqa.org/en/latest/whatsnew/
"Bug tracker" = https://github.com/PyCQA/pylint/issues
"Discord server" = https://discord.gg/kFebW799
"User manual" = http://pylint.pycqa.org/en/latest/
"Contributing" = http://pylint.pycqa.org/en/latest/development_guide/contribute.html
"Technical references" = http://pylint.pycqa.org/en/latest/technical_reference/index.html
"Mailing list" = mailto:code-quality@python.org

[options]
packages = find:
Pierre-Sassoulas marked this conversation as resolved.
Show resolved Hide resolved
Pierre-Sassoulas marked this conversation as resolved.
Show resolved Hide resolved
install_requires =
astroid>=2.5.2,<2.7
isort>=4.2.5,<6
mccabe>=0.6,<0.7
toml>=0.7.1
colorama;sys_platform=="win32"
python_requires = ~=3.6

[options.packages.find]
include =
pylint*

[options.entry_points]
console_scripts =
pylint = pylint:run_pylint
epylint = pylint:run_epylint
pyreverse = pylint:run_pyreverse
symilar = pylint:run_symilar

[aliases]
test = pytest

[tool:pytest]
testpaths = tests
python_files = *test_*.py
addopts = -m "not acceptance"
markers =
acceptance:
benchmark: Baseline of pylint performance, if this regress something serious happened

[isort]
multi_line_output = 3
line_length = 88
known_third_party = astroid, sphinx, isort, pytest, mccabe, six, toml
include_trailing_comma = True
skip_glob = tests/functional/**,tests/input/**,tests/extensions/data/**,tests/regrtest_data/**,tests/data/**,astroid/**,venv/**
src_paths = pylint
Loading