palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.6k stars 282 forks source link

Several pylint tests are failing #897

Closed juliangilbey closed 3 years ago

juliangilbey commented 3 years ago

In https://github.com/palantir/python-language-server/blob/7d7f6a47b9487b29bd8a07776dcf5425e0877d6f/test/plugins/test_pylint_lint.py#L54 the config is updated to run pylint using stdin. Unfortunately, for some reason that I haven't yet fathomed, that is not actually working and so the test_pylint test is failing: adding the diagnostic line

print("new config setting = %s" % config.plugin_settings('pylint'))

immediately after it just prints new config setting = {}. So something has clearly gone wrong somewhere - perhaps it's some changed behaviour of Python 3.9?

I've tried working my way through config.py, but with no success.

This is not the only pylint test to fail: test_syntax_error_pylint_py3 fails for what appears to be a similar reason, test_lint_free_pylint fails for a reason I don't understand, and test_per_file_caching also fails for a reason I don't understand.

I'm using pylint version 2.6.0.

Update: added relevant part of log file: python-language-server_0.36.2-pylint-test.txt

juliangilbey commented 3 years ago

Update: it turns out that they only fail when run from the build tree before installation. After installation, they all work fine.

There are some deprecation warnings though, but they come from different packages:

=============================== warnings summary ===============================
test/plugins/test_pylint_lint.py::test_pylint
  /usr/lib/python3/dist-packages/pydocstyle/config.py:6: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
    from collections import Set, namedtuple

test/plugins/test_pylint_lint.py::test_pylint
  /usr/lib/python3/dist-packages/yapf/__init__.py:35: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
    from lib2to3.pgen2 import tokenize
ccordoba12 commented 3 years ago

This package needs to be installed in development mode because it uses setuptools entry points to load its plugins.