1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 rustPlatform, 6 cargo, 7 rustc, 8 setuptools, 9 tree-sitter, 10 pytestCheckHook, 11}: 12 13buildPythonPackage rec { 14 pname = "tree-sitter-yaml"; 15 version = "0.7.1"; 16 pyproject = true; 17 18 src = fetchFromGitHub { 19 owner = "tree-sitter-grammars"; 20 repo = "tree-sitter-yaml"; 21 tag = "v${version}"; 22 hash = "sha256-Z2L/aQWIyZ8cSqbfjm/i10fJP++yZ2tZgho0U3asA0g="; 23 }; 24 25 cargoDeps = rustPlatform.fetchCargoVendor { 26 inherit src; 27 hash = "sha256-QvqvyjnCgSuSiiY4SB5nB9S7LnGP1F+tySxue359SWY="; 28 }; 29 30 build-system = [ 31 cargo 32 rustPlatform.cargoSetupHook 33 rustc 34 setuptools 35 ]; 36 37 optional-dependencies = { 38 core = [ 39 tree-sitter 40 ]; 41 }; 42 43 pythonImportsCheck = [ "tree_sitter_yaml" ]; 44 45 nativeCheckInputs = [ 46 pytestCheckHook 47 tree-sitter 48 ]; 49 50 meta = { 51 description = "YAML grammar for tree-sitter"; 52 homepage = "https://github.com/tree-sitter-grammars/tree-sitter-yaml"; 53 license = lib.licenses.mit; 54 maintainers = with lib.maintainers; [ yzx9 ]; 55 }; 56}