Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pytestCheckHook, 6 pythonOlder, 7 setuptools, 8 tree-sitter-python, 9 tree-sitter-rust, 10 tree-sitter-html, 11 tree-sitter-javascript, 12 tree-sitter-json, 13}: 14 15buildPythonPackage rec { 16 pname = "tree-sitter"; 17 version = "0.22.3"; 18 pyproject = true; 19 20 disabled = pythonOlder "3.7"; 21 22 src = fetchFromGitHub { 23 owner = "tree-sitter"; 24 repo = "py-tree-sitter"; 25 rev = "refs/tags/v${version}"; 26 hash = "sha256-4lxE8oDFE0X7YAnB72PKIaHIqovWSM5QnFo0grPAtKU="; 27 fetchSubmodules = true; 28 }; 29 30 build-system = [ setuptools ]; 31 32 nativeCheckInputs = [ 33 pytestCheckHook 34 tree-sitter-python 35 tree-sitter-rust 36 tree-sitter-html 37 tree-sitter-javascript 38 tree-sitter-json 39 ]; 40 41 pythonImportsCheck = [ "tree_sitter" ]; 42 43 preCheck = '' 44 # https://github.com/NixOS/nixpkgs/issues/255262#issuecomment-1721265871 45 rm -r tree_sitter 46 ''; 47 48 meta = with lib; { 49 description = "Python bindings to the Tree-sitter parsing library"; 50 homepage = "https://github.com/tree-sitter/py-tree-sitter"; 51 changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/v${version}"; 52 license = licenses.mit; 53 maintainers = with maintainers; [ fab ]; 54 }; 55}