OCA / pylint-odoo

Odoo plugin for Pylint
http://www.pylint.org
143 stars 168 forks source link

Incompatibility with pylint 2.13 #416

Closed vincent-hatakeyama closed 1 year ago

vincent-hatakeyama commented 1 year ago

Describe the bug

It was done on a system with 3.6, but installing pylint-odoo installed the version 8.0.4 of pylint-odoo and version 2.13.9 of pylint.

When pylint is run, it crashes with an attribute error.

To Reproduce

Affected versions: 8.0.4

Steps to reproduce the behavior:

  1. With a python 3.6 install pylint-odoo with pip. It should be possible to reproduce in more recent python by setting the pylint version to pylint<2.14.
  2. Run pylint, this error is raised:
  File "/var/lib/odoo/.local/lib/python3.6/site-packages/pylint_odoo/checkers/odoo_addons.py", line 696, in OdooAddons
    @utils.only_required_for_messages(
AttributeError: module 'pylint.checkers.utils' has no attribute 'only_required_for_messages'

Expected behavior pylint-odoo should declare the minimum version of pylint it is compatible with for each feature it uses.

Additional context Python 3.6

moylop260 commented 1 year ago

Hi @vincent-hatakeyama

It is expected

New pylint-odoo >=8.0 is only compatible with new version of pylint

if you need a particular version of pylint so you should install pylint-odoo<8.0 instead

More information related:

vincent-hatakeyama commented 1 year ago

https://github.com/OCA/pylint-odoo/blob/main/requirements.txt#L2 indeed has a dependency on pylint 2.15 while https://github.com/OCA/pylint-odoo/blob/main/setup.py#L27 shows that requirements.txt is used to generate the requirements.

I’ve tested with a couple of different pip versions. The issue seems to be with it.

moylop260 commented 1 year ago

New pylint is not compatible with py3.6

FYI https://github.com/OCA/pylint-odoo/pull/417

vincent-hatakeyama commented 1 year ago

I know it is not compatible. Neither is pip⩾22.

I’ve tested with pyhon 3.9 in a virtualenv. Asking pip to install pylint-odoo pylint==2.13.5, it will select version 8.0 of pylint-odoo (which is indicated as compatible). But when using an old version of pip, for example version 9, it installs the latest version of pylint-odoo. Some version give an error message about incompatibility.

So the issue is with pip, not pylint-odoo, so I’m closing this.