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

Remove 2.8.0 breaking changes in __pkginfo__ #4400

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Release date: TBA
..
Put new features and bugfixes here and also in 'doc/whatsnew/2.9.rst'

* Add numversion back (temporarily) in ``__pkginfo__`` because it broke Pylama and revert the unnecessary
``pylint.version`` breaking change.

Closes #4399


What's New in Pylint 2.8.0?
===========================
Expand Down Expand Up @@ -46,7 +51,7 @@ Release date: 2021-04-24
* 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')``.
accessible with ``from importlib import metadata;metadata.metadata('pylint')``.

* COPYING has been renamed to LICENSE for standardization.

Expand Down
14 changes: 11 additions & 3 deletions doc/whatsnew/2.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
Summary -- Release highlights
=============================

Breaking changes
================

* The 'doc' extra-require has been removed. `__pkginfo__`` does not contain the package metadata anymore
(except ``numversion``, until 3.0). Meta-information are accessible with

```python
from importlib import metadata
metadata.metadata('pylint')
```
Prefer that to an import from ``__pkginfo__``.

New checkers
============
Expand Down Expand Up @@ -43,9 +54,6 @@ Other Changes
* The packaging is now done via setuptools exclusively. ``doc``, ``tests``, ``man``, ``elisp`` and ``Changelog`` are
not packaged anymore - reducing the size of the package by 75%.

* The 'doc' extra-require has been removed. ``pylint.version`` is now ``pylint.__version__`` and ``__pkginfo__`` does
not contain the package metadata anymore.

* Updated ``astroid`` to 2.5.4

* COPYING has been renamed to LICENSE for standardization.
3 changes: 2 additions & 1 deletion pylint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ def modify_sys_path() -> None:
sys.path.pop(1)


__all__ = ["__version__"]
version = __version__
__all__ = ["__version__", "version"]
4 changes: 4 additions & 0 deletions pylint/__pkginfo__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
__version__ += f"a{dev_version}"
else:
__version__ += f".dev{dev_version}"


# Kept for compatibility reason, see https://github.com/PyCQA/pylint/issues/4399
numversion = __version__.split(".")
Comment on lines +18 to +19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In <2.8 is was a tuple, not a list, see fbcb27a#diff-42df8bb8e2d7b0a18f0174dcb5f3c60b1cbca5a394c3c7f8c9b33c99fb6cda99L34

list causes the following TypeError in pylint-django (pylint-dev/pylint-django#323)

LOAD_CONFIGURATION_SUPPORTED = pylint.__pkginfo__.numversion >= (2, 3)
TypeError: '>=' not supported between instances of 'list' and 'tuple'