diff --git a/pkgs/by-name/au/autotools-language-server/package.nix b/pkgs/by-name/au/autotools-language-server/package.nix index d79889fe2c33a..9cd9c57ba463a 100644 --- a/pkgs/by-name/au/autotools-language-server/package.nix +++ b/pkgs/by-name/au/autotools-language-server/package.nix @@ -5,7 +5,10 @@ }: let - python3 = python311; + python3 = python311.override { + self = python3; + packageOverrides = _: super: { tree-sitter = super.tree-sitter_0_21; }; + }; in python3.pkgs.buildPythonApplication rec { pname = "autotools-language-server"; diff --git a/pkgs/development/python-modules/lsp-tree-sitter/default.nix b/pkgs/development/python-modules/lsp-tree-sitter/default.nix index 2dc8597727590..a0530544a9380 100644 --- a/pkgs/development/python-modules/lsp-tree-sitter/default.nix +++ b/pkgs/development/python-modules/lsp-tree-sitter/default.nix @@ -1,14 +1,15 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, setuptools-generate -, setuptools-scm -, colorama -, jinja2 -, jsonschema -, pygls -, tree-sitter0_21 -, pytestCheckHook +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools-generate, + setuptools-scm, + colorama, + jinja2, + jsonschema, + pygls, + tree-sitter, + pytestCheckHook, }: buildPythonPackage rec { @@ -33,16 +34,9 @@ buildPythonPackage rec { jinja2 jsonschema pygls - # The build won't fail if we had used tree-sitter (version > 0.21), but - # this package is only a dependency of autotools-language-server which also - # depends on tree-sitter-languages which must use tree-sitter0_21 and not - # tree-sitter. Hence we avoid different tree-sitter versions dependency - # mismatch by defaulting here to this lower version. - tree-sitter0_21 - ]; - nativeCheckInputs = [ - pytestCheckHook + tree-sitter ]; + nativeCheckInputs = [ pytestCheckHook ]; pythonImportsCheck = [ "lsp_tree_sitter" ]; diff --git a/pkgs/development/python-modules/textual/default.nix b/pkgs/development/python-modules/textual/default.nix index 0d0f3d82a55e1..37aa589b29ea4 100644 --- a/pkgs/development/python-modules/textual/default.nix +++ b/pkgs/development/python-modules/textual/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { pytestCheckHook syrupy time-machine - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + tree-sitter + ]; disabledTestPaths = [ # Snapshot tests require syrupy<4 diff --git a/pkgs/development/python-modules/tree-sitter-languages/default.nix b/pkgs/development/python-modules/tree-sitter-languages/default.nix index a118e4ffe0cca..9636b3dc95354 100644 --- a/pkgs/development/python-modules/tree-sitter-languages/default.nix +++ b/pkgs/development/python-modules/tree-sitter-languages/default.nix @@ -1,12 +1,12 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, setuptools -, wheel -, cython -, tree-sitter0_21 -, pytestCheckHook -, python +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + cython, + tree-sitter, + pytestCheckHook, + python, }: buildPythonPackage rec { @@ -34,20 +34,14 @@ buildPythonPackage rec { build-system = [ setuptools - wheel cython ]; - dependencies = [ - # https://github.com/grantjenks/py-tree-sitter-languages/issues/67 - tree-sitter0_21 - ]; + dependencies = [ tree-sitter ]; # Generate languages.so file (build won't fail without this, but tests will). preBuild = '' ${python.pythonOnBuildForHost.interpreter} build.py ''; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; # Without cd $out, tests fail to import the compiled cython extensions. # Without copying the ./tests/ directory to $out, pytest won't detect the # tests and run them. See also: @@ -64,5 +58,7 @@ buildPythonPackage rec { homepage = "https://github.com/grantjenks/py-tree-sitter-languages"; license = licenses.asl20; maintainers = with maintainers; [ doronbehar ]; + # https://github.com/grantjenks/py-tree-sitter-languages/issues/67 + broken = versionAtLeast tree-sitter.version "0.22"; }; } diff --git a/pkgs/development/python-modules/tree-sitter0_21/default.nix b/pkgs/development/python-modules/tree-sitter/0_21.nix similarity index 97% rename from pkgs/development/python-modules/tree-sitter0_21/default.nix rename to pkgs/development/python-modules/tree-sitter/0_21.nix index 2e0dde0da3a69..1d3326ea967a5 100644 --- a/pkgs/development/python-modules/tree-sitter0_21/default.nix +++ b/pkgs/development/python-modules/tree-sitter/0_21.nix @@ -10,7 +10,7 @@ }: buildPythonPackage rec { - pname = "tree-sitter0_21"; + pname = "tree-sitter"; version = "0.21.3"; pyproject = true; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 15b05f4b9fb8b..c555d591f7116 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15814,7 +15814,7 @@ self: super: with self; { tree-sitter = callPackage ../development/python-modules/tree-sitter { }; - tree-sitter0_21 = callPackage ../development/python-modules/tree-sitter0_21 { }; + tree-sitter_0_21 = callPackage ../development/python-modules/tree-sitter/0_21.nix { }; tree-sitter-html = callPackage ../development/python-modules/tree-sitter-html { };