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

v1.1.6.4 still breaks pylint #335

Closed
feenes opened this issue Jun 13, 2019 · 19 comments
Closed

v1.1.6.4 still breaks pylint #335

feenes opened this issue Jun 13, 2019 · 19 comments

Comments

@feenes
Copy link

feenes commented Jun 13, 2019

For versions 1.1.6.3 and 1.1.6.4 I get following error during our CI runs.

We had no issue (except contradicting dependencies with flake8) before

The related error log:

$ prospector
Messages
========

.
  Line: None
    pylint: failure / Tool pylint failed to run (exception was raised)



Check Information
=================
         Started: 2019-06-13 08:48:04.082400
        Finished: 2019-06-13 08:48:19.840839
      Time Taken: 15.76 seconds
       Formatter: grouped
        Profiles: .prospector.yaml, no_doc_warnings, no_member_warnings, no_test_warnings, strictness_medium, strictness_high, strictness_veryhigh
      Strictness: from profile
  Libraries Used: 
       Tools Run: pep8, profile-validator, pyflakes, pylint
  Messages Found: 1

ERROR: Job failed: exit status 1

pip check output:

$ cat pipcheck.txt
No broken requirements found.

Have to change our CI pipeline to add output of pip freeze

@carlio
Copy link
Member

carlio commented Jun 13, 2019

Can you rerun with the -X flag to prospector? That'll show you the stacktrace caused by pylint, then add that here, which would be useful for debugging this.

@feenes
Copy link
Author

feenes commented Jun 13, 2019

changed our CI pipeline:

WIth -X I don't get the previous error message anymore. Probably this is what should happen when calling with ',-X' ?

Here the output of prospector -X:

$ prospector -X
Traceback (most recent call last):
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/bin/prospector", line 10, in <module>
    sys.exit(main())
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/prospector/run.py", line 173, in main
    prospector.execute()
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/prospector/run.py", line 66, in execute
    messages += tool.run(found_files)
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/prospector/tools/pylint/__init__.py", line 254, in run
    self._linter.check(self._args)
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/pylint/lint.py", line 943, in check
    self._do_check(files_or_modules)
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/pylint/lint.py", line 1081, in _do_check
    self.add_message(msgid, line, None, args)
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/pylint/utils.py", line 496, in add_message
    message_definition, line, node, args, confidence, col_offset
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/pylint/utils.py", line 571, in add_one_message
    confidence,
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/prospector/tools/pylint/collector.py", line 21, in handle_message
    self.add_message(msg.msg_id, location, msg.msg)
  File "/home/gitlab-runner/builds/30c73d6d/0/x/y/eenv/lib/python3.6/site-packages/prospector/tools/pylint/collector.py", line 32, in add_message
    msg_data = self._message_store.get_message_definition(msg_id)
AttributeError: 'MessagesStore' object has no attribute 'get_message_definition'
ERROR: Job failed: exit status 1

And here the output of pip freeze:

asn1crypto==0.24.0
astroid==2.2.5
atomicwrites==1.3.0
attrs==19.1.0
backcall==0.1.0
bcrypt==3.1.6
begins==0.9
boto3==1.9.167
botocore==1.12.167
cairocffi==1.0.2
CairoSVG==2.4.0
certifi==2019.3.9
cffi==1.12.3
chardet==3.0.4
Click==7.0
coverage==4.5.3
cryptography==2.7
cssselect==1.0.3
cssselect2==0.2.1
decorator==4.4.0
defusedxml==0.6.0
Django==1.11.21
django-cors-headers==3.0.2
django-debug-toolbar==1.4
django-extensions==2.1.9
django-filter==1.1.0
django-jsonfield==1.2.0
djangorestframework==3.6.4
docutils==0.14
dodgy==0.1.9
entrypoints==0.3
Fabric3==1.14.post1
factory-boy==2.12.0
Faker==1.0.7
filemagic==1.6
future==0.17.1
holidays==0.9.10
html5lib==1.0.1
idna==2.8
importlib-metadata==0.18
ipython==7.5.0
ipython-genutils==0.2.0
isort==4.3.20
jedi==0.13.3
jmespath==0.9.4
lazy-object-proxy==1.4.1
lxml==4.3.4
mccabe==0.6.1
minibelt==0.1.1
mock==3.0.5
more-itertools==7.0.0
packaging==19.0
paramiko==2.5.0
parso==0.4.0
pep8==1.7.1
pep8-naming==0.4.1
pexpect==4.7.0
pickleshare==0.7.5
Pillow==6.0.0
pluggy==0.12.0
prompt-toolkit==2.0.9
prospector==1.1.6.4
psycopg2-binary==2.8.2
ptyprocess==0.6.0
py==1.8.0
pycodestyle==2.4.0
pycparser==2.19
pydocstyle==3.0.0
pyflakes==1.6.0
pygal==2.4.0
Pygments==2.4.2
pylint==2.3.1
pylint-celery==0.3
pylint-common==0.2.5
pylint-django==2.0.9
pylint-flask==0.6
pylint-plugin-utils==0.5
PyNaCl==1.3.0
pyotp==2.2.7
pyparsing==2.4.0
PyPDF2==1.26.0
Pyphen==0.9.5
pytest==4.6.3
pytest-django==3.5.0
python-dateutil==2.8.0
pytz==2019.1
PyYAML==5.1.1
requests==2.22.0
requirements-detector==0.6
responses==0.10.6
s3transfer==0.2.1
setoptconf==0.2.0
six==1.12.0
snowballstemmer==1.2.1
sqlparse==0.3.0
text-unidecode==1.2
tinycss==0.4
tinycss2==1.0.2
traitlets==4.3.2
typed-ast==1.4.0
urllib3==1.25.3
uWSGI==2.0.18
wcwidth==0.1.7
WeasyPrint==0.36
webencodings==0.5.1
wrapt==1.11.1
yapf==0.27.0
zipp==0.5.1

@sphuber
Copy link

sphuber commented Jun 13, 2019

This is the same problem that I reported in #321

@feenes
Copy link
Author

feenes commented Jun 13, 2019

Yes this looks identical.

What is weird however is, that I have the problem only with 1.1.6.3 and 1.1.6.4 which were release only a few days ago, but you encountered the problem already in March.

With 1.1.6.2 I do not have this issue

@sphuber
Copy link

sphuber commented Jun 13, 2019

Could it be that when you ran with 1.1.6.2 you happened to run with another version of pylint that was compatible. But now in the new runs, prospector will also install pylint==2.3.* which causes the failure

@feenes
Copy link
Author

feenes commented Jun 13, 2019

I will force 1.1.6.2 and dump the output of pip freeze

@feenes
Copy link
Author

feenes commented Jun 13, 2019

@sphuber You're right
My yesterday's fix
pip install prospector -U 'prospector!=1.1.6.3'

will install prospector==1.1.6.4 and pylint==2.3.1

whereas
pip install -U 'prospector!=1.1.6.3,!=1.1.6.4'
will install prospector==1.1.6.2 and pylint==2.1.1

@feenes
Copy link
Author

feenes commented Jun 13, 2019

Please advice:

Normally I do not like too much to limit the max versions of packages in my pip installs, but if it is probable, that the next release will still have this issue I'll probably go for the time being for something like
pip install -U 'prospector==1.1.6.2 in order to not block the developers waiting for our CI runs to pass.

@chocoelho
Copy link
Contributor

@carlio the issue is within get_message_definition that got renamed and returns now a list, by changing the call to how Pylint uses it internally, it works again https://github.com/PyCQA/pylint/blob/master/pylint/message/message_store.py#L42

@chocoelho
Copy link
Contributor

Though, there's an issue I noticed yesterday EOD an issue with pylint-django, described in here: pylint-dev/pylint-django#232

For now, it's better to use 1.1.6.2 while this is under fixing.

@chocoelho
Copy link
Contributor

I'm already discussing inside pylint-dev/pylint-django#232 to have support for the latest pylint version with a new release of pylint-django ASAP.

@jabdoa2
Copy link

jabdoa2 commented Jun 15, 2019

We got the same issue but we are not using django.

wmfgerrit pushed a commit to wikimedia/operations-software-spicerack that referenced this issue Jun 17, 2019
* Due to landscapeio/prospector#335 the latest
  version of prospector fails to run pylint. Forcing the max version of
  it to the last one that runs without errors temporarily.

Change-Id: Idafbe6ba032f1cb635c3f15e3fd4c5be77f27f2e
wmfgerrit pushed a commit to wikimedia/operations-cookbooks that referenced this issue Jun 17, 2019
* Due to landscapeio/prospector#335 the latest
  version of prospector fails to run pylint. Forcing the max version of
  it to the last one that runs without errors temporarily.

Change-Id: I7b924e32a7c3110943ceb52f8bddf0d1dace2ce9
Deimos added a commit to spectria/tildes that referenced this issue Jun 21, 2019
prospector 1.1.6.4 is currently broken - it updates to a new version of
pylint that it isn't compatible with. The relevant issue is here:
landscapeio/prospector#335
@volans-
Copy link
Contributor

volans- commented Jul 10, 2019

Any news on this?

@jabdoa2: that's independent of your project, prospector has pylint-django as dependency, see https://github.com/PyCQA/prospector/blob/master/setup.py#L35

@chocoelho
Copy link
Contributor

Hey there folks, sorry about the delay. As we're still reviewing #342, we published a pre-release version 1.1.7.dev0. It'd be nice if you could give it a try and help us out testing the next version candidate.

@sphuber
Copy link

sphuber commented Jul 17, 2019

Thanks a lot for the new release. I tested it for our deployment on py2 and py3 and both now work with prospector==1.1.7dev0

@volans-
Copy link
Contributor

volans- commented Jul 17, 2019

@chocoelho thanks for the test release. I can confirm both 1.1.6.2 and 1.1.7.dev0 works fine while 1.1.6.4 fails for the repository where I had the issue. I tested it on Python 3.5, 3.6, 3.7.

@chocoelho
Copy link
Contributor

chocoelho commented Jul 18, 2019

That's great! Will start using pre-releases before making sudden changes as it was intended with 1.1.6.3 and 1.1.6.4. Sorry about that y'all, and we expect to release 1.1.7 soon.

wmfgerrit pushed a commit to wikimedia/cumin that referenced this issue Jul 19, 2019
* Due to landscapeio/prospector#335 the latest
  version of prospector fails to run pylint. Forcing the max version of
  it to the last one that runs without errors temporarily.

Change-Id: Ibea6d0a84f6c743a78b8798fe1be6e70be9a1a41
@ggravlingen
Copy link

ggravlingen commented Jul 21, 2019

I came here after also experiencing some problems with pylint and prospector. Tried the pre-release of 1.1.7 and still get an error. Had another error before upgrading though. Perhaps I should move this comment to an issue instead to keep this PR clean?

Traceback (most recent call last):
  File "/home/vsts/work/1/s/venv/lib/python3.5/site-packages/astroid/bases.py", line 183, in getattr
    values = self._proxied.instance_attr(name, context)
  File "/home/vsts/work/1/s/venv/lib/python3.5/site-packages/astroid/scoped_nodes.py", line 2311, in instance_attr
    target=self, attribute=name, context=context
astroid.exceptions.AttributeInferenceError: 'index' not found on <ClassDef.SingleBlockManager l.1435 at 0x7f1a68f67908>.

Full stack trace here:
https://hastebin.com/uhokilefup.sql

What I'm trying to wrap my head around at the moment is if there's anything in my code or if there is really something going on with Astroid.

Edit: since it's a Pandas-file that causes the crash I believe it's linked to these issues: pylint-dev/pylint#2843 and pylint-dev/pylint#2811 rather than Prospector so please disregard.

@chocoelho
Copy link
Contributor

Closing this as prospector 1.1.7 should fix this issue. Feel free to reopen it if this is erroring for you.

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

No branches or pull requests

7 participants