Skip to content

Commit

Permalink
Merge pull request #214720 from kalekseev/init/ruff-lsp
Browse files Browse the repository at this point in the history
python3Packages.ruff-lsp: init at 0.0.24
  • Loading branch information
wegank authored Apr 26, 2023
2 parents 92d5bc4 + 86fd55b commit 966144b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
63 changes: 63 additions & 0 deletions pkgs/development/python-modules/ruff-lsp/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10507,6 +10507,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 { };
Expand Down

0 comments on commit 966144b

Please sign in to comment.