From 14da51500d417ab901402fca0aa3c19e03b77e84 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 3 Jul 2021 13:10:19 +0200 Subject: [PATCH 1/3] python3Packages.python-lsp-jsonrpc: init at 1.0.0 --- .../python-lsp-jsonrpc/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/python-lsp-jsonrpc/default.nix diff --git a/pkgs/development/python-modules/python-lsp-jsonrpc/default.nix b/pkgs/development/python-modules/python-lsp-jsonrpc/default.nix new file mode 100644 index 000000000000..6938bc282f88 --- /dev/null +++ b/pkgs/development/python-modules/python-lsp-jsonrpc/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, ujson +}: + +buildPythonPackage rec { + pname = "python-lsp-jsonrpc"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "python-lsp"; + repo = pname; + rev = "v${version}"; + sha256 = "0h4bs8s4axcm0p02v59amz9sq3nr4zhzdgwq7iaw6awl27v1hd0i"; + }; + + propagatedBuildInputs = [ + ujson + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "--cov-report html --cov-report term --junitxml=pytest.xml" "" \ + --replace "--cov pylsp_jsonrpc --cov test" "" + ''; + + pythonImportsCheck = [ "pylsp_jsonrpc" ]; + + meta = with lib; { + description = "Python server implementation of the JSON RPC 2.0 protocol."; + homepage = "https://github.com/python-lsp/python-lsp-jsonrpc"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5eac97ab1891..abef85b75748 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6998,6 +6998,8 @@ in { python-louvain = callPackage ../development/python-modules/python-louvain { }; + python-lsp-jsonrpc = callPackage ../development/python-modules/python-lsp-jsonrpc { }; + python-ly = callPackage ../development/python-modules/python-ly { }; python-lz4 = callPackage ../development/python-modules/python-lz4 { }; From bebb18083ffa6b89946b76ebe3cb07fa929487c1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 3 Jul 2021 13:36:10 +0200 Subject: [PATCH 2/3] python3Packages.python-lsp-server: init at 1.1.0 --- .../python-lsp-server/default.nix | 81 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 83 insertions(+) create mode 100644 pkgs/development/python-modules/python-lsp-server/default.nix diff --git a/pkgs/development/python-modules/python-lsp-server/default.nix b/pkgs/development/python-modules/python-lsp-server/default.nix new file mode 100644 index 000000000000..6a2c396ecf89 --- /dev/null +++ b/pkgs/development/python-modules/python-lsp-server/default.nix @@ -0,0 +1,81 @@ +{ lib +, autopep8 +, buildPythonPackage +, fetchFromGitHub +, flake8 +, flaky +, jedi +, matplotlib +, mccabe +, numpy +, pandas +, pluggy +, pycodestyle +, pydocstyle +, pyflakes +, pylint +, pyqt5 +, pytestCheckHook +, python-lsp-jsonrpc +, pythonOlder +, rope +, ujson +, yapf +}: + +buildPythonPackage rec { + pname = "python-lsp-server"; + version = "1.1.0"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "python-lsp"; + repo = pname; + rev = "v${version}"; + sha256 = "1akdpfnylqg2mcwpkqmdwcg6j6hab23slp5rfjfidhphig2f2yjv"; + }; + + propagatedBuildInputs = [ + autopep8 + flake8 + jedi + mccabe + pluggy + pycodestyle + pydocstyle + pyflakes + pylint + python-lsp-jsonrpc + rope + ujson + yapf + ]; + + checkInputs = [ + flaky + matplotlib + numpy + pandas + pyqt5 + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "--cov-report html --cov-report term --junitxml=pytest.xml" "" \ + --replace "--cov pylsp --cov test" "" + ''; + + preCheck = '' + export HOME=$(mktemp -d); + ''; + + pythonImportsCheck = [ "pylsp" ]; + + meta = with lib; { + description = "Python implementation of the Language Server Protocol"; + homepage = "https://github.com/python-lsp/python-lsp-server"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index abef85b75748..2569a12249d3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7000,6 +7000,8 @@ in { python-lsp-jsonrpc = callPackage ../development/python-modules/python-lsp-jsonrpc { }; + python-lsp-server = callPackage ../development/python-modules/python-lsp-server { }; + python-ly = callPackage ../development/python-modules/python-ly { }; python-lz4 = callPackage ../development/python-modules/python-lz4 { }; From 98dbeb6b790de67b9d8f39968e09836304516fb9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 3 Jul 2021 13:44:59 +0200 Subject: [PATCH 3/3] python3Packages.pyls-spyder: fix build --- .../python-modules/pyls-spyder/default.nix | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pyls-spyder/default.nix b/pkgs/development/python-modules/pyls-spyder/default.nix index 4e0029783eb6..61b0fa7449bc 100644 --- a/pkgs/development/python-modules/pyls-spyder/default.nix +++ b/pkgs/development/python-modules/pyls-spyder/default.nix @@ -1,18 +1,29 @@ -{ lib, buildPythonPackage, fetchPypi, python-language-server }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, python-lsp-server +, pytestCheckHook +}: buildPythonPackage rec { pname = "pyls-spyder"; version = "0.4.0"; - src = fetchPypi { - inherit pname version; - sha256 = "45a321c83f64267d82907492c55199fccabda45bc872dd23bf1efd08edac1b0b"; + src = fetchFromGitHub { + owner = "spyder-ide"; + repo = pname; + rev = "v${version}"; + sha256 = "11ajbsia60d4c9s6m6rbvaqp1d69fcdbq6a98lkzkkzv2b9pdhkk"; }; - propagatedBuildInputs = [ python-language-server ]; + propagatedBuildInputs = [ + python-lsp-server + ]; + + checkInputs = [ + pytestCheckHook + ]; - # no tests - doCheck = false; pythonImportsCheck = [ "pyls_spyder" ]; meta = with lib; {