1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pythonOlder
6, setuptools
7, setuptools-scm
8, ujson
9}:
10
11buildPythonPackage rec {
12 pname = "python-lsp-jsonrpc";
13 version = "1.1.2";
14 format = "pyproject";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "python-lsp";
20 repo = pname;
21 rev = "refs/tags/v${version}";
22 hash = "sha256-5WN/31e6WCgXVzevMuQbNjyo/2jjWDF+m48nrLKS+64=";
23 };
24
25 SETUPTOOLS_SCM_PRETEND_VERSION = version;
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace "--cov-report html --cov-report term --junitxml=pytest.xml --cov pylsp_jsonrpc --cov test" ""
30 '';
31
32 nativeBuildInputs = [
33 setuptools
34 setuptools-scm
35 ];
36
37 propagatedBuildInputs = [
38 ujson
39 ];
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 ];
44
45 pythonImportsCheck = [
46 "pylsp_jsonrpc"
47 ];
48
49 meta = with lib; {
50 description = "Python server implementation of the JSON RPC 2.0 protocol";
51 homepage = "https://github.com/python-lsp/python-lsp-jsonrpc";
52 changelog = "https://github.com/python-lsp/python-lsp-jsonrpc/blob/v${version}/CHANGELOG.md";
53 license = licenses.mit;
54 maintainers = with maintainers; [ fab ];
55 };
56}