about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2024-03-20 10:28:52 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2024-03-20 10:28:52 +0100
commit09484b3b3712653c9365da2366da18a9dc4cf99e (patch)
treeff22da46a0b6f124daded04c756e3b2f29c878be /pkgs/development
parent85426e06d04791293b4741205f4813de49952e28 (diff)
python311Packages.tree-sitter: 0.20.4 -> 0.21.1
Changelog: https://github.com/tree-sitter/py-tree-sitter/releases/tag/v0.21.1
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/tree-sitter/default.nix27
1 files changed, 16 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/tree-sitter/default.nix b/pkgs/development/python-modules/tree-sitter/default.nix
index cd572618a2fd8..6843791f89fc7 100644
--- a/pkgs/development/python-modules/tree-sitter/default.nix
+++ b/pkgs/development/python-modules/tree-sitter/default.nix
@@ -1,37 +1,42 @@
 { lib
 , buildPythonPackage
-, fetchPypi
+, fetchFromGitHub
 , pytestCheckHook
 , pythonOlder
 , setuptools
-, wheel
 }:
 
 buildPythonPackage rec {
   pname = "tree-sitter";
-  version = "0.20.4";
-  format = "pyproject";
+  version = "0.21.1";
+  pyproject = true;
 
   disabled = pythonOlder "3.7";
 
-  src = fetchPypi {
-    pname = "tree_sitter";
-    inherit version;
-    hash = "sha256-atsSPi8+VjmbvyNZkkYzyILMQO6DRIhSALygki9xO+U=";
+  src = fetchFromGitHub {
+    owner = "tree-sitter";
+    repo = "py-tree-sitter";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-U4ZdU0lxjZO/y0q20bG5CLKipnfpaxzV3AFR6fGS7m4=";
+    fetchSubmodules = true;
   };
 
   nativeBuildInputs = [
     setuptools
-    wheel
   ];
 
-  # PyPI tarball doesn't contains tests and source has additional requirements
-  doCheck = false;
+  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";