bcb2f287e1
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
setuptools,
|
|
tree-sitter-python,
|
|
tree-sitter-rust,
|
|
tree-sitter-html,
|
|
tree-sitter-javascript,
|
|
tree-sitter-json,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "tree-sitter";
|
|
version = "0.22.3";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "tree-sitter";
|
|
repo = "py-tree-sitter";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-4lxE8oDFE0X7YAnB72PKIaHIqovWSM5QnFo0grPAtKU=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
tree-sitter-python
|
|
tree-sitter-rust
|
|
tree-sitter-html
|
|
tree-sitter-javascript
|
|
tree-sitter-json
|
|
];
|
|
|
|
pythonImportsCheck = [ "tree_sitter" ];
|
|
|
|
preCheck = ''
|
|
# https://github.com/NixOS/nixpkgs/issues/255262#issuecomment-1721265871
|
|
rm -r tree_sitter
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Python bindings to the Tree-sitter parsing library";
|
|
homepage = "https://github.com/tree-sitter/py-tree-sitter";
|
|
changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/v${version}";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|