1{ lib
2, buildPythonPackage
3, fetchPypi
4, pytestCheckHook
5, pythonOlder
6, setuptools
7, wheel
8}:
9
10buildPythonPackage rec {
11 pname = "tree-sitter";
12 version = "0.20.4";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchPypi {
18 pname = "tree_sitter";
19 inherit version;
20 hash = "sha256-atsSPi8+VjmbvyNZkkYzyILMQO6DRIhSALygki9xO+U=";
21 };
22
23 nativeBuildInputs = [
24 setuptools
25 wheel
26 ];
27
28 # PyPI tarball doesn't contains tests and source has additional requirements
29 doCheck = false;
30
31 pythonImportsCheck = [
32 "tree_sitter"
33 ];
34
35 meta = with lib; {
36 description = "Python bindings to the Tree-sitter parsing library";
37 homepage = "https://github.com/tree-sitter/py-tree-sitter";
38 license = licenses.mit;
39 maintainers = with maintainers; [ fab ];
40 };
41}