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-embedded-template"; 15 version = "0.23.2"; 16 pyproject = true; 17 18 src = fetchFromGitHub { 19 owner = "tree-sitter"; 20 repo = "tree-sitter-embedded-template"; 21 tag = "v${version}"; 22 hash = "sha256-C2Lo3tT2363O++ycXiR6x0y+jy2zlmhcKp7t1LhvCe8="; 23 }; 24 25 cargoDeps = rustPlatform.fetchCargoVendor { 26 inherit src; 27 hash = "sha256-DscTKXKukh3RsqtKjplyzrxY977zUgpFpeXtFOLJEXA="; 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_embedded_template" ]; 44 45 nativeCheckInputs = [ 46 pytestCheckHook 47 tree-sitter 48 ]; 49 50 meta = { 51 description = "Tree-sitter grammar for embedded template languages like ERB, EJS"; 52 homepage = "https://github.com/tree-sitter/tree-sitter-embedded-template"; 53 license = lib.licenses.mit; 54 maintainers = with lib.maintainers; [ yzx9 ]; 55 }; 56}