Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

91 rinda
2.9 KiB

  1. { stdenv, buildPythonPackage, fetchFromGitHub, fetchpatch, pythonOlder, isPy27
  2. , backports_functools_lru_cache, configparser, futures, future, jedi, pluggy, python-jsonrpc-server, flake8
  3. , pytestCheckHook, mock, pytestcov, coverage, setuptools, ujson
  4. , # Allow building a limited set of providers, e.g. ["pycodestyle"].
  5. providers ? ["*"]
  6. # The following packages are optional and
  7. # can be overwritten with null as your liking.
  8. , autopep8 ? null
  9. , mccabe ? null
  10. , pycodestyle ? null
  11. , pydocstyle ? null
  12. , pyflakes ? null
  13. , pylint ? null
  14. , rope ? null
  15. , yapf ? null
  16. }:
  17. let
  18. withProvider = p: builtins.elem "*" providers || builtins.elem p providers;
  19. in
  20. buildPythonPackage rec {
  21. pname = "python-language-server";
  22. version = "0.34.1";
  23. src = fetchFromGitHub {
  24. owner = "palantir";
  25. repo = "python-language-server";
  26. rev = version;
  27. sha256 = "sha256-/tVzaoyUO6+7DSvnf3JxpcTY0rU+hHBu5qlru/ZTpxU=";
  28. };
  29. patches = [
  30. # https://github.com/palantir/python-language-server/pull/851
  31. (fetchpatch {
  32. url = "https://github.com/palantir/python-language-server/commit/f513f3297132492dd41e001d943980e6c4f40809.patch";
  33. sha256 = "04c9hrb3dzlfchjk4625ipazyfcbq6qq2kj2hg3zf2xsny2jcvi5";
  34. })
  35. ];
  36. postPatch = ''
  37. # https://github.com/palantir/python-jsonrpc-server/issues/36
  38. sed -i -e 's!ujson<=!ujson>=!' setup.py
  39. '';
  40. # The tests require all the providers, disable otherwise.
  41. doCheck = providers == ["*"];
  42. checkInputs = [
  43. pytestCheckHook mock pytestcov coverage
  44. # rope is technically a dependency, but we don't add it by default since we
  45. # already have jedi, which is the preferred option
  46. rope
  47. ];
  48. dontUseSetuptoolsCheck = true;
  49. preCheck = ''
  50. export HOME=$TEMPDIR
  51. '';
  52. # Tests failed since update to 0.31.8
  53. disabledTests = [
  54. "test_pyqt_completion"
  55. "test_numpy_completions"
  56. "test_pandas_completions"
  57. "test_matplotlib_completions"
  58. "test_snippet_parsing"
  59. "test_numpy_hover"
  60. ] ++ stdenv.lib.optional isPy27 "test_flake8_lint";
  61. propagatedBuildInputs = [ setuptools jedi pluggy future python-jsonrpc-server flake8 ujson ]
  62. ++ stdenv.lib.optional (withProvider "autopep8") autopep8
  63. ++ stdenv.lib.optional (withProvider "mccabe") mccabe
  64. ++ stdenv.lib.optional (withProvider "pycodestyle") pycodestyle
  65. ++ stdenv.lib.optional (withProvider "pydocstyle") pydocstyle
  66. ++ stdenv.lib.optional (withProvider "pyflakes") pyflakes
  67. ++ stdenv.lib.optional (withProvider "pylint") pylint
  68. ++ stdenv.lib.optional (withProvider "rope") rope
  69. ++ stdenv.lib.optional (withProvider "yapf") yapf
  70. ++ stdenv.lib.optional isPy27 configparser
  71. ++ stdenv.lib.optionals (pythonOlder "3.2") [ backports_functools_lru_cache futures ];
  72. meta = with stdenv.lib; {
  73. homepage = "https://github.com/palantir/python-language-server";
  74. description = "An implementation of the Language Server Protocol for Python";
  75. license = licenses.mit;
  76. maintainers = [ maintainers.mic92 ];
  77. };
  78. }