Merge pull request #228465 from linsui/python-lsp-ruff

python3Packages.python-lsp-ruff: init at 1.4.0
This commit is contained in:
Mario Rodas 2023-04-29 09:37:08 -05:00 committed by GitHub
commit 54abe781c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,45 @@
{ lib
, pythonOlder
, buildPythonPackage
, fetchPypi
, ruff
, lsprotocol
, python-lsp-server
, tomli
}:
buildPythonPackage rec {
pname = "python-lsp-ruff";
version = "1.4.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit version;
pname = "python-lsp-ruff";
sha256 = "sha256-TqTeQc/lT5DcPcJbZXbEiUGbYjFP8idpzdSZlXD59Y4=";
};
postPatch = ''
# ruff binary is used directly, the ruff python package is not needed
sed -i '/"ruff>=/d' pyproject.toml
sed -i 's|sys.executable, "-m", "ruff"|"${ruff}/bin/ruff"|' pylsp_ruff/plugin.py
'';
propagatedBuildInputs = [
lsprotocol
python-lsp-server
] ++ lib.optionals (pythonOlder "3.11") [
tomli
];
doCheck = true;
meta = with lib; {
homepage = "https://github.com/python-lsp/python-lsp-ruff";
description = "Ruff linting plugin for pylsp";
changelog = "https://github.com/python-lsp/python-lsp-ruff/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ linsui ];
};
}

View File

@ -9607,6 +9607,8 @@ self: super: with self; {
python-lsp-jsonrpc = callPackage ../development/python-modules/python-lsp-jsonrpc { };
python-lsp-ruff = callPackage ../development/python-modules/python-lsp-ruff { };
python-lsp-server = callPackage ../development/python-modules/python-lsp-server { };
python-ly = callPackage ../development/python-modules/python-ly { };