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

pylama is complaining about pylint not existing #4399

Closed
rzuckerm opened this issue Apr 25, 2021 · 5 comments · Fixed by #4400
Closed

pylama is complaining about pylint not existing #4399

rzuckerm opened this issue Apr 25, 2021 · 5 comments · Fixed by #4400
Milestone

Comments

@rzuckerm
Copy link

Steps to reproduce

$ virtualenv -p python3 pylama
...
$ . pylama/bin/activate
(pylama) $ pip install pylama pylint
(pylama) $ pylama -l pylint
...

Current behavior

(pylama) $ pylama -l pylint
WARNING:root:Linter `pylint` not found.
(pylama) $ python3
Python 3.8.8 (default, Feb 20 2021, 21:09:14) 
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylama.lint.pylama_pylint import Linter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/master-ouno23vh/test_pkg/.porg/venvs/3.8/lib/python3.8/site-packages/pylama/lint/pylama_pylint.py", line 7, in <module>
    from pylint.__pkginfo__ import numversion
ImportError: cannot import name 'numversion' from 'pylint.__pkginfo__' (/tmp/master-ouno23vh/test_pkg/.porg/venvs/3.8/lib/python3.8/site-packages/pylint/__pkginfo__.py)
>>> 

Expected behavior

Prior to 2.8.0, pylama worked just fine. I think pylama is expecting numversion to have a tuple containing the major, minor, and patch version digits. In 2.7.4, there was this. In 2.8.0, that variable seems to have been removed.

pylint --version output

Result of pylint --version output:

(pylama) $ pylint --version
pylint 2.8.0
astroid 2.5.5
Python 3.8.8 (default, Feb 20 2021, 21:09:14) 
[GCC 7.5.0]

Other packages installed:

(pylama) $ pip freeze
astroid==2.5.5
isort==5.8.0
lazy-object-proxy==1.6.0
mccabe==0.6.1
pycodestyle==2.7.0
pydocstyle==6.0.0
pyflakes==2.3.1
pylama==7.7.1
pylint==2.8.0
snowballstemmer==2.1.0
toml==0.10.2
wrapt==1.12.1
@rzuckerm
Copy link
Author

Although this is probably a pylama bug, that project hasn't released a new version since 2019, so it looks like it is an abandoned projected. However, our CI uses pylama, and due to this problem, I cannot upgrade pylint to the latest version.

@Pierre-Sassoulas
Copy link
Member

Sorry about that, the import should be changed to from pylint import __version__ line 7 in pylama/lint/pylama_pylint.py. Maybe we could make this retro compatible if a new release of pylama is unlikely.

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Apr 25, 2021

I opened a PR in pylama, let's hope it get merged. We're not going to add back this (we might want to add scm_setuptools later, upgrading manually the version do not make sense), the real metadata of the package are accessible with:

from importlib import metadata
metadata.metadata('pylint')

(Could be a better fix than what I did for pylama.)

@Pierre-Sassoulas
Copy link
Member

Actually we can stay compatible.

@rzuckerm
Copy link
Author

@Pierre-Sassoulas Thanks, for you quick response on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants