From 6379453fa35b1e0fa50ea62caac7f9a618ec0102 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 30 Mar 2025 11:30:02 +0200 Subject: [PATCH] python312Packages.tree-sitter-c-sharp: cleanup, add tests --- .../tree-sitter-c-sharp/default.nix | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/tree-sitter-c-sharp/default.nix b/pkgs/development/python-modules/tree-sitter-c-sharp/default.nix index 5b24e7d0f4be..4514a8cc258b 100644 --- a/pkgs/development/python-modules/tree-sitter-c-sharp/default.nix +++ b/pkgs/development/python-modules/tree-sitter-c-sharp/default.nix @@ -2,30 +2,25 @@ lib, fetchFromGitHub, buildPythonPackage, - pythonOlder, - cargo, rustPlatform, + cargo, rustc, setuptools, - wheel, tree-sitter, + pytestCheckHook, }: -let +buildPythonPackage rec { + pname = "tree-sitter-c-sharp"; version = "0.23.1"; + pyproject = true; src = fetchFromGitHub { owner = "tree-sitter"; repo = "tree-sitter-c-sharp"; - rev = "v${version}"; + tag = "v${version}"; hash = "sha256-weH0nyLpvVK/OpgvOjTuJdH2Hm4a1wVshHmhUdFq3XA="; }; -in -buildPythonPackage { - pname = "tree-sitter-c-sharp"; - inherit version src; - pyproject = true; - disabled = pythonOlder "3.9"; cargoDeps = rustPlatform.fetchCargoVendor { inherit src; @@ -37,7 +32,6 @@ buildPythonPackage { rustPlatform.cargoSetupHook rustc setuptools - wheel ]; optional-dependencies = { @@ -46,8 +40,11 @@ buildPythonPackage { ]; }; - pythonImportsCheck = [ - "tree_sitter_c_sharp" + pythonImportsCheck = [ "tree_sitter_c_sharp" ]; + + nativeCheckInputs = [ + pytestCheckHook + tree-sitter ]; meta = {