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

Server warns when optional modules do not exist #265

Closed
doolio opened this issue Sep 12, 2022 · 2 comments · Fixed by #266
Closed

Server warns when optional modules do not exist #265

doolio opened this issue Sep 12, 2022 · 2 comments · Fixed by #266
Milestone

Comments

@doolio
Copy link
Contributor

doolio commented Sep 12, 2022

I did not install autopep8 (preferring black), pylint (preferring flake8), rope (preferring jedi) or yapf (preferring black). Taking that into account I see the following warning messages in [stderr] even if I have disabled these options in my server configuration. Should this happen? I would have thought if those modules were disabled in the configuration one should not see such warnings.

WARNING - pylsp.config.config - Failed to load pylsp entry point 'autopep8': No module named 'autopep8'   
WARNING - pylsp.config.config - Failed to load pylsp entry point 'pylint': No module named 'pylint'       
WARNING - pylsp.config.config - Failed to load pylsp entry point 'rope_completion': No module named 'rope'
WARNING - pylsp.config.config - Failed to load pylsp entry point 'rope_rename': No module named 'rope'    
WARNING - pylsp.config.config - Failed to load pylsp entry point 'yapf': No module named 'yapf'           
@krassowski
Copy link
Contributor

+1, I think we should change it to log.info instead. The code is here:

# Pluggy will skip loading a plugin if it throws a DistributionNotFound exception.
# However I don't want all plugins to have to catch ImportError and re-throw. So here we'll filter
# out any entry points that throw ImportError assuming one or more of their dependencies isn't present.
for entry_point in pkg_resources.iter_entry_points(PYLSP):
try:
entry_point.load()
except Exception as e: # pylint: disable=broad-except
log.warning("Failed to load %s entry point '%s': %s", PYLSP, entry_point.name, e)
self._pm.set_blocked(entry_point.name)

@ccordoba12
Copy link
Member

Agreed. @doolio, could you submit a PR for that?

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

Successfully merging a pull request may close this issue.

3 participants