From 09484b3b3712653c9365da2366da18a9dc4cf99e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 20 Mar 2024 10:28:52 +0100 Subject: [PATCH] python311Packages.tree-sitter: 0.20.4 -> 0.21.1 Changelog: https://github.com/tree-sitter/py-tree-sitter/releases/tag/v0.21.1 --- .../python-modules/tree-sitter/default.nix | 27 +++++++++++-------- 1 file 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 cd572618a2fd..6843791f89fc 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";