depot/third_party/nixpkgs/pkgs/development/python-modules/tree-sitter0_21/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

44 lines
1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
pythonOlder,
pythonAtLeast,
setuptools,
}:
buildPythonPackage rec {
pname = "tree-sitter0_21";
version = "0.21.3";
pyproject = true;
# https://github.com/tree-sitter/py-tree-sitter/issues/209
disabled = pythonAtLeast "3.12" || pythonOlder "3.7";
src = fetchFromGitHub {
owner = "tree-sitter";
repo = "py-tree-sitter";
rev = "refs/tags/v${version}";
hash = "sha256-HT1sRzDFpeelWCq1ZMeRmoUg0a3SBR7bZKxBqn4fb2g=";
fetchSubmodules = true;
};
build-system = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "tree_sitter" ];
preCheck = ''
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 ];
};
}