From 99b403be36eb783637105996189bb1954972719c Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 14 Nov 2023 19:57:00 +0100 Subject: development: use ruff in pylsp, remove other tools --- usecases/desktop/development.nix | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) (limited to 'usecases') diff --git a/usecases/desktop/development.nix b/usecases/desktop/development.nix index a347df8..28cb7f2 100644 --- a/usecases/desktop/development.nix +++ b/usecases/desktop/development.nix @@ -17,12 +17,13 @@ inputs: { vimPlugins ; - pylsp = with pkgs.unstable.python3Packages; - python-lsp-server.overrideAttrs (old: { - propagatedBuildInputs = - old.propagatedBuildInputs - ++ python-lsp-server.passthru.optional-dependencies.all; - }); + pylsp-env = pkgs.unstable.python3.withPackages (p: + with p; [ + python-lsp-server + python-lsp-server.passthru.optional-dependencies.rope + python-lsp-ruff + pylsp-rope + ]); luaFormat = inputs.self.lib.generators.lua {}; in { @@ -82,15 +83,7 @@ in { taplo # Python - black - python3Packages.isort - python3Packages.mypy python3Packages.tox - # TODO: how to install into pylsp's python env? - # python-lsp-black - # pyls-isort - # pylsp-mypy - ruff neovide @@ -131,20 +124,11 @@ in { }; }; marksman.cmd = ["${marksman}/bin/marksman"]; + # TODO: replace with nixd? nil_ls.cmd = ["${nil}/bin/nil"]; pylsp = { - cmd = ["${pylsp}/bin/pylsp"]; - settings.pylsp.plugins = { - autopep8.enabled = false; - flake8.ignore = ["E501"]; - pycodestyle.ignore = ["E501"]; - yapf.enabled = false; - - # See TODO above - #black.enabled = true; - #isort.enabled = true; - #mypy.enabled = true; - }; + cmd = ["${pylsp-env}/bin/pylsp"]; + settings.pylsp.plugins.ruff.enabled = true; }; }; @@ -218,9 +202,9 @@ in { RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; CARGO_HOME = "${config.xdg.dataHome}/cargo"; - RUFF_CACHE_DIR= "${config.xdg.cacheHome}/ruff"; + RUFF_CACHE_DIR = "${config.xdg.cacheHome}/ruff"; - PYTHONPYCACHEPREFIX= "${config.xdg.cacheHome}/python"; + PYTHONPYCACHEPREFIX = "${config.xdg.cacheHome}/python"; PYTHONUSERBASE = "${config.xdg.dataHome}/python"; _JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${config.xdg.configHome}/java"; -- cgit v1.2.3