From 86fd55beb21420d96c3e9f5ddd08f4346bfcfcb1 Mon Sep 17 00:00:00 2001 From: Konstantin Alekseev Date: Sun, 5 Feb 2023 11:41:35 +0200 Subject: [PATCH] python3Packages.ruff-lsp: init at 0.0.24 --- .../python-modules/ruff-lsp/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/python-modules/ruff-lsp/default.nix diff --git a/pkgs/development/python-modules/ruff-lsp/default.nix b/pkgs/development/python-modules/ruff-lsp/default.nix new file mode 100644 index 0000000000000..7ef48b86fa0ba --- /dev/null +++ b/pkgs/development/python-modules/ruff-lsp/default.nix @@ -0,0 +1,63 @@ +{ lib +, stdenv +, pythonOlder +, buildPythonPackage +, fetchPypi +, ruff +, pygls +, lsprotocol +, hatchling +, typing-extensions +, unittestCheckHook +, python-lsp-jsonrpc +}: + +buildPythonPackage rec { + pname = "ruff-lsp"; + version = "0.0.24"; + format = "pyproject"; + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit version; + pname = "ruff_lsp"; + sha256 = "sha256-1he/GYk8O9LqPXH3mu7eGWuRygiDG1OnJ+JNT2Pynzo="; + }; + + postPatch = '' + # ruff binary added to PATH in wrapper so it's not needed + sed -i '/"ruff>=/d' pyproject.toml + ''; + + nativeBuildInputs = [ + hatchling + ]; + + propagatedBuildInputs = [ + pygls + lsprotocol + typing-extensions + ]; + + doCheck = stdenv.isDarwin; + + nativeCheckInputs = [ + unittestCheckHook + python-lsp-jsonrpc + ruff + ]; + + makeWrapperArgs = [ + # prefer ruff from user's PATH, that's usually desired behavior + "--suffix PATH : ${lib.makeBinPath [ ruff ]}" + ]; + + + meta = with lib; { + homepage = "https://github.com/charliermarsh/ruff-lsp"; + description = "A Language Server Protocol implementation for Ruff"; + changelog = "https://github.com/charliermarsh/ruff-lsp/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ kalekseev ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1f627f5383bc3..5f657564e2f75 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10457,6 +10457,8 @@ self: super: with self; { rubymarshal = callPackage ../development/python-modules/rubymarshal { }; + ruff-lsp = callPackage ../development/python-modules/ruff-lsp { }; + ruffus = callPackage ../development/python-modules/ruffus { }; runway-python = callPackage ../development/python-modules/runway-python { };