python_lsp_server.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from .config import load_config_schema
  2. from .utils import PythonModuleSpec
  3. class PythonLSPServer(PythonModuleSpec):
  4. python_module = key = "pylsp"
  5. languages = ["python"]
  6. spec = dict(
  7. display_name="python-lsp-server (pylsp)",
  8. mime_types=["text/python", "text/x-ipython"],
  9. urls=dict(
  10. home="https://github.com/python-lsp/python-lsp-server",
  11. issues="https://github.com/python-lsp/python-lsp-server/issues",
  12. ),
  13. install=dict(
  14. pip="pip install 'python-lsp-server[all]'",
  15. conda="conda install -c conda-forge python-lsp-server",
  16. ),
  17. extend=[
  18. dict(
  19. display_name="pyls-mypy",
  20. install=dict(
  21. pip="pip install pyls-mypy", conda="conda install pyls-mypy"
  22. ),
  23. ),
  24. dict(
  25. display_name="pyls-black",
  26. install=dict(
  27. pip="pip install pyls-black", conda="conda install pyls-black"
  28. ),
  29. ),
  30. dict(
  31. display_name="pyls-isort",
  32. install=dict(
  33. pip="pip install pyls-isort",
  34. conda="conda install pyls-isort",
  35. ),
  36. ),
  37. dict(
  38. display_name="pyls-memestra",
  39. install=dict(
  40. pip="pip install pyls-memestra",
  41. conda="conda install pyls-memestra",
  42. ),
  43. ),
  44. ],
  45. config_schema=load_config_schema(key),
  46. env=dict(PYTHONUNBUFFERED="1"),
  47. )