lol

{python3Packages.textual,tree-sitter.grammars}: unbreak (#428417)

authored by

Yt and committed by
GitHub
cf497a82 1733b682

+89 -120
-21
pkgs/by-name/ai/aider-chat/fix-tree-sitter.patch
··· 1 - diff --git a/aider/repomap.py b/aider/repomap.py 2 - index 23eee239..0a40f2e6 100644 3 - --- a/aider/repomap.py 4 - +++ b/aider/repomap.py 5 - @@ -16,6 +16,7 @@ from grep_ast import TreeContext, filename_to_lang 6 - from pygments.lexers import guess_lexer_for_filename 7 - from pygments.token import Token 8 - from tqdm import tqdm 9 - +from tree_sitter import QueryCursor 10 - 11 - from aider.dump import dump 12 - from aider.special import filter_important_files 13 - @@ -286,7 +287,7 @@ class RepoMap: 14 - 15 - # Run the tags queries 16 - query = language.query(query_scm) 17 - - captures = query.captures(tree.root_node) 18 - + captures = QueryCursor(query).captures(tree.root_node) 19 - 20 - saw = set() 21 - if USING_TSL_PACK:
-2
pkgs/by-name/ai/aider-chat/package.nix
··· 146 146 ]; 147 147 148 148 patches = [ 149 - ./fix-tree-sitter.patch 150 - 151 149 (replaceVars ./fix-flake8-invoke.patch { 152 150 flake8 = lib.getExe python3Packages.flake8; 153 151 })
-2
pkgs/development/python-modules/textual/default.nix
··· 95 95 changelog = "https://github.com/Textualize/textual/blob/${src.tag}/CHANGELOG.md"; 96 96 license = lib.licenses.mit; 97 97 maintainers = with lib.maintainers; [ gepbird ]; 98 - # https://github.com/Textualize/textual/issues/5868 99 - broken = true; 100 98 }; 101 99 }
+2 -2
pkgs/development/python-modules/tree-sitter-rust/default.nix
··· 8 8 9 9 buildPythonPackage rec { 10 10 pname = "tree-sitter-rust"; 11 - version = "0.24.0"; 11 + version = "0.23.2"; 12 12 pyproject = true; 13 13 14 14 src = fetchFromGitHub { 15 15 owner = "tree-sitter"; 16 16 repo = "tree-sitter-rust"; 17 17 tag = "v${version}"; 18 - hash = "sha256-y3sJURlSTM7LRRN5WGIAeslsdRZU522Tfcu6dnXH/XQ="; 18 + hash = "sha256-aT+tlrEKMgWqTEq/NHh8Vj92h6i1aU6uPikDyaP2vfc="; 19 19 }; 20 20 21 21 build-system = [
+12 -27
pkgs/development/python-modules/tree-sitter/default.nix
··· 2 2 lib, 3 3 stdenv, 4 4 buildPythonPackage, 5 - fetchFromGitHub, 6 - pytestCheckHook, 5 + fetchPypi, 7 6 pythonOlder, 8 7 setuptools, 9 8 tree-sitter-python, ··· 15 14 16 15 buildPythonPackage rec { 17 16 pname = "tree-sitter"; 18 - version = "0.24.0-unstable-2025-06-02"; 17 + version = "0.24.0"; 19 18 pyproject = true; 20 19 21 20 disabled = pythonOlder "3.10"; 22 21 23 - src = fetchFromGitHub { 24 - owner = "tree-sitter"; 25 - repo = "py-tree-sitter"; 26 - rev = "9c78f3b8d10f81b97fbb2181c9333323d6375480"; 27 - hash = "sha256-jPqTraGrYFXBlci4Zaleyp/NTQhvuI39tYWRckjnV2E="; 28 - fetchSubmodules = true; 22 + src = fetchPypi { 23 + inherit pname version; 24 + hash = "sha256-q9la9lyi9Pfso1Y0M5HtZp52Tzd0i1NSlG8A9/x45zQ="; 29 25 }; 30 26 31 27 # see https://github.com/tree-sitter/py-tree-sitter/issues/330#issuecomment-2629403946 ··· 36 32 build-system = [ setuptools ]; 37 33 38 34 nativeCheckInputs = [ 39 - pytestCheckHook 40 35 tree-sitter-python 41 36 tree-sitter-rust 42 37 tree-sitter-html ··· 56 51 "test_dot_graphs" 57 52 ]; 58 53 59 - meta = 60 - let 61 - # for an -unstable version, we grab the release notes for the last tagged 62 - # version it is based upon 63 - lastTag = lib.pipe version [ 64 - lib.splitVersion 65 - (lib.take 3) 66 - (lib.concatStringsSep ".") 67 - ]; 68 - in 69 - { 70 - description = "Python bindings to the Tree-sitter parsing library"; 71 - homepage = "https://github.com/tree-sitter/py-tree-sitter"; 72 - changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/v${lastTag}"; 73 - license = lib.licenses.mit; 74 - maintainers = with lib.maintainers; [ fab ]; 75 - }; 54 + meta = { 55 + description = "Python bindings to the Tree-sitter parsing library"; 56 + homepage = "https://github.com/tree-sitter/py-tree-sitter"; 57 + changelog = "https://github.com/tree-sitter/py-tree-sitter/releases/tag/v${version}"; 58 + license = lib.licenses.mit; 59 + maintainers = with lib.maintainers; [ fab ]; 60 + }; 76 61 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-bash.json
··· 1 1 { 2 2 "url": "https://github.com/tree-sitter/tree-sitter-bash", 3 - "rev": "56b54c61fb48bce0c63e3dfa2240b5d274384763", 4 - "date": "2025-06-04T09:38:10-07:00", 5 - "path": "/nix/store/zy2ii6304db3z54x2afg8as71wkbgffd-tree-sitter-bash", 6 - "sha256": "1488r0lqldy92v8jr3n6w6iv99fdbcnmb1zxfshiz9azcgz8s5mx", 7 - "hash": "sha256-vRaN/mNfpR+hdv2HVS1bzaW0o+HGjizRFsk3iinICJE=", 3 + "rev": "487734f87fd87118028a65a4599352fa99c9cde8", 4 + "date": "2024-11-11T01:52:16-05:00", 5 + "path": "/nix/store/llqfabr73wh33skh2qzhwjh93zc5cy09-tree-sitter-bash", 6 + "sha256": "1smlcfkxxknhya1b1h72zj3ccg35szbg9mii2xwh7iq9acnlzpgc", 7 + "hash": "sha256-7N1PLVMJxwN5FzHW9NbXZTzGhvziwLCC8tDO3qdjtOo=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-bibtex.json
··· 1 1 { 2 2 "url": "https://github.com/latex-lsp/tree-sitter-bibtex", 3 - "rev": "8d04ed27b3bc7929f14b7df9236797dab9f3fa66", 4 - "date": "2025-04-19T10:23:36+02:00", 5 - "path": "/nix/store/cfx6c2nl3vmm29phi5l7yg4mq8hapqji-tree-sitter-bibtex", 6 - "sha256": "0pjjk23a3gyz0rpgy99qkal9gs65i15k8bsc37s87x94dxdcdrah", 7 - "hash": "sha256-UOXGWm8k9YP0GUwvNEuIxeiXqJo4Jf9uBt+/oYaYUl4=", 3 + "rev": "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34", 4 + "date": "2021-03-26T15:53:50+01:00", 5 + "path": "/nix/store/pg00zy53rni7znda2vbyyhkkclgja3kq-tree-sitter-bibtex", 6 + "sha256": "0m7f3dkqbmy8x1bhl11m8f4p6n76wfvh99rp46zrqv39355nw1y2", 7 + "hash": "sha256-wgduSxlpbJy/ITenBLfj5lhziUM1BApX6MjXhWcb7lQ=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c.json
··· 1 1 { 2 2 "url": "https://github.com/tree-sitter/tree-sitter-c", 3 - "rev": "7fa1be1b694b6e763686793d97da01f36a0e5c12", 4 - "date": "2025-05-24T13:29:12-04:00", 5 - "path": "/nix/store/bms26kscizz0zd4x18smicqz5p7va9d4-tree-sitter-c", 6 - "sha256": "19yc4g5fdibfqbn49ggywk9k2by78s8lrsjp1cx2lagb1dvxnv42", 7 - "hash": "sha256-gmzbdwvrKSo6C1fqTJFGxy8x0+T+vUTswm7F5sojzKc=", 3 + "rev": "2a265d69a4caf57108a73ad2ed1e6922dd2f998c", 4 + "date": "2025-02-08T10:48:10-06:00", 5 + "path": "/nix/store/0xnd082cryjnml9iaibcfgbp3bc5svxb-tree-sitter-c", 6 + "sha256": "1vw7jd3wrb4vnigfllfmqxa8fwcpvgp1invswizz0grxv249piza", 7 + "hash": "sha256-6sebiNg9P/B/5HrbGO7bl3GHVMfVUepetJuszEeTh+8=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-comment.json
··· 1 1 { 2 2 "url": "https://github.com/stsewd/tree-sitter-comment", 3 - "rev": "689be73775bd2dd57b938b8e12bf50fec35a6ca3", 4 - "date": "2025-05-03T18:43:55-05:00", 5 - "path": "/nix/store/7s2q0ka47nf94kaih3w12572my3r2ksz-tree-sitter-comment", 6 - "sha256": "1x0l8phr4x07n739z0ax8faxq0l6irmpkdprrv1z088zqdr43l1v", 7 - "hash": "sha256-O9BBcsMfIfDDzvm2eWuOhgLclUNdgZ/GsQd0kuFFFPQ=", 3 + "rev": "ef429992748f89e176243411e94b8ffc8777d118", 4 + "date": "2023-06-03T20:48:17-05:00", 5 + "path": "/nix/store/0kg71dvg10f1m2f08z1b2wh1ap4w4hw6-tree-sitter-comment", 6 + "sha256": "1d5g69i8jplyg888yr7wzjb46cqnchwf4kdzgb83him7cwfx9wax", 7 + "hash": "sha256-XfHUHWenRjjQer9N4jhkFjNDlvz8ZI8Qep5eiWIyr7Q=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fortran.json
··· 1 1 { 2 2 "url": "https://github.com/stadelmanma/tree-sitter-fortran", 3 - "rev": "ab9aa007a8d982a5a7926663a8ab989cea0f5d9e", 4 - "date": "2025-05-30T13:36:15-04:00", 5 - "path": "/nix/store/rfny2ivglrrr0wqsby82l0yw63d3gdvp-tree-sitter-fortran", 6 - "sha256": "13szimmilfd1lps9j73zyp4lmg630ml1gg802lsfxxdjc944yrcc", 7 - "hash": "sha256-jGVPSGKy9e40FQC9F2gFw7xKyfV/HJn0paE5GmuNX48=", 3 + "rev": "022b032d31299c5d8336cdfd0ece97de20a609c0", 4 + "date": "2025-01-23T13:28:14-05:00", 5 + "path": "/nix/store/vncpfx5db12ish9rzf26phj25373nqs4-tree-sitter-fortran", 6 + "sha256": "1mncdji60qa9r8jbiywmcid714ylc3gniq25l8mxj1p4zq95nd29", 7 + "hash": "sha256-STRbEv7kBtkrokXgaN9g1JNwWmSV+7gkyklhYKJszNY=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-hcl.json
··· 1 1 { 2 2 "url": "https://github.com/MichaHoffmann/tree-sitter-hcl", 3 - "rev": "009def4ae38ec30e5b40beeae26efe93484ab286", 4 - "date": "2025-05-16T09:08:19+02:00", 5 - "path": "/nix/store/4fzs7sm98lvygqj7ylpfhg9lpkzyz8as-tree-sitter-hcl", 6 - "sha256": "01amk7cm968a3i511kzzbyvhbxhk6h1v5g5klap7vh0y11r3ilyy", 7 - "hash": "sha256-3tM4cggewH2uorO8sgM0E/YFt1//zxBKHAqZVNmZVQU=", 3 + "rev": "636dbe70301ecbab8f353c8c78b3406fe4f185f5", 4 + "date": "2023-07-25T19:21:31+02:00", 5 + "path": "/nix/store/k5rmjfpgn4vpxxqc05xb5fflcck9645v-tree-sitter-hcl", 6 + "sha256": "1yydi61jki7xpabi0aq6ykz4w4cya15g8rp34apb6qq9hm4lm9di", 7 + "hash": "sha256-saVKSYUJY7OuIuNm9EpQnhFO/vQGKxCXuv3EKYOJzfs=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-hyprlang.json
··· 1 1 { 2 2 "url": "https://github.com/tree-sitter-grammars/tree-sitter-hyprlang", 3 - "rev": "d0441fd4b883ecc0e70140723a1cf5907992639a", 4 - "date": "2025-05-09T22:23:24+03:00", 5 - "path": "/nix/store/ajpg66r1yvns2rpbspqhgh7b1ggm6jcf-tree-sitter-hyprlang", 6 - "sha256": "171p3hj36a1jqflg9xv138445j4m4m16na6bgpm1km3l67jhvl54", 7 - "hash": "sha256-pNAN5TF01Bnqfcsoa0IllchCCBph9/SowzIoMyQcN5w=", 3 + "rev": "86025136c12cd1058985479a6b1935829077f1af", 4 + "date": "2024-02-10T18:00:17+03:00", 5 + "path": "/nix/store/q5csx65ydwbz66bgjjpa6c1yvy3zy6vq-tree-sitter-hyprlang", 6 + "sha256": "0z84nl1mb77rwqq86ggaiqdd2lwg3nxrlkbhsn8zhcqnaphq0wfl", 7 + "hash": "sha256-1HGA4VUWM/iR1XBNmrsdj1PRGo7qPYMw5vmcVQO1BH0=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-llvm.json
··· 1 1 { 2 2 "url": "https://github.com/benwilliamgraham/tree-sitter-llvm", 3 - "rev": "1ac83114e71839fa67f4cce2f864ebbbdf6e2a4f", 4 - "date": "2025-05-13T09:33:06+02:00", 5 - "path": "/nix/store/yqc7r12pmy0y1bxad2cgpss5kpmd9vzr-tree-sitter-llvm", 6 - "sha256": "00srqg073ml85zimmj1a1251nka18i04gm0m1jcpa6fmbbrx6knr", 7 - "hash": "sha256-2U7T81rVGXWZDBXUR0BEQU0biggqyFrjL4jWccDDWQM=", 3 + "rev": "c14cb839003348692158b845db9edda201374548", 4 + "date": "2024-10-07T15:28:34-07:00", 5 + "path": "/nix/store/aravnn08ip3zggkbww6ap73xb5zvrf6g-tree-sitter-llvm", 6 + "sha256": "1fh5nq7war87zrphlv5v2g55gmsbhyv3385va7k1y8gh3czg0x9g", 7 + "hash": "sha256-L3XwPhvwIR/mUbugMbaHS9dXyhO7bApv/gdlxQ+2Bbo=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-markdown.json
··· 1 1 { 2 2 "url": "https://github.com/MDeiml/tree-sitter-markdown", 3 - "rev": "afaa4138517363362f54c89330c9d79391e81168", 4 - "date": "2025-05-17T18:46:59+02:00", 5 - "path": "/nix/store/46fzwyl91h2w34b73sscbjh1ggl3s15l-tree-sitter-markdown", 6 - "sha256": "0aprf5kvqcpjx58xwdxh4lsgz6mzcsdipjv3405fywcrbh9q7li3", 7 - "hash": "sha256-I9KDE1yZce8KIGPLG5tmv5r/NCWwN95R6fIyvGdx+So=", 3 + "rev": "1c8dea73bc0c996d92dd9ebc30dd388716b1c5db", 4 + "date": "2024-09-11T16:28:36+03:00", 5 + "path": "/nix/store/g4696miy9vzcw0qwd00rar36qn08jn2l-tree-sitter-markdown", 6 + "sha256": "13xfyclim1yql6swbk4y12sxgvn799ldbzjl35n5rrkz7wgnwm9s", 7 + "hash": "sha256-OlVuHz9/5lxsGVT+1WhKx+7XtQiezMW1odiHGinzro8=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-query.json
··· 1 1 { 2 2 "url": "https://github.com/nvim-treesitter/tree-sitter-query", 3 - "rev": "892ebd701a79be0412ff1478177030a725d0c7b7", 4 - "date": "2025-05-16T18:22:36+02:00", 5 - "path": "/nix/store/rivlmbcc3gn7fqwljgk3z7zhk2s1ivzh-tree-sitter-query", 6 - "sha256": "0is8lzj13zz6sq36wrfmhv7mjbgfvlrqnxf5dxzqa2vncj45v0bv", 7 - "hash": "sha256-e4FdiGR2C4V/b8V1izPd7i1Zz4bVZW4G1ub/EeSnSEc=", 3 + "rev": "0555ac0da902abff06076e40501102cee3ba68bd", 4 + "date": "2025-02-02T17:30:49+01:00", 5 + "path": "/nix/store/ab5v1pf3vckwhnix7r0c1l5g8x30v4zl-tree-sitter-query", 6 + "sha256": "0dqy7i2jdd9dqf1ppqzcmkzd9yndb11r78l0pv1zyl7dm7h5g76q", 7 + "hash": "sha256-2JxX4KntUP/DvoCik0NYzfrU/qzs43uDwy21JkU8Hjc=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+5 -6
pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rust.json
··· 1 1 { 2 2 "url": "https://github.com/tree-sitter/tree-sitter-rust", 3 - "rev": "18b0515fca567f5a10aee9978c6d2640e878671a", 4 - "date": "2025-04-01T14:02:57-07:00", 5 - "path": "/nix/store/ilgg71axwwq17wcpy3sm5qkqkfh26bgd-tree-sitter-rust", 6 - "sha256": "0x7xqxspdfnbgn9nvrsl2rsnrjbs01i5hy8k8p5wwk2j358hjyyb", 7 - "hash": "sha256-y3sJURlSTM7LRRN5WGIAeslsdRZU522Tfcu6dnXH/XQ=", 3 + "rev": "cad8a206f2e4194676b9699f26f6560d07130d3f", 4 + "date": "2024-11-24T13:48:58-05:00", 5 + "path": "/nix/store/2xxvslz0q5vl8z94hs1g8cb4x2ri2pan-tree-sitter-rust", 6 + "sha256": "1xxxysiwj0r97sp4wsdmm23pcgsngiw39gsa9jm0achan6basgv9", 7 + "hash": "sha256-aT+tlrEKMgWqTEq/NHh8Vj92h6i1aU6uPikDyaP2vfc=", 8 8 "fetchLFS": false, 9 9 "fetchSubmodules": false, 10 10 "deepClone": false, 11 - "fetchTags": false, 12 11 "leaveDotGit": false 13 12 }
+16
pkgs/development/tools/parsing/tree-sitter/update.nix
··· 494 494 }; 495 495 }; 496 496 497 + pinnedGrammars = [ 498 + "tree-sitter-bash" 499 + "tree-sitter-bibtex" 500 + "tree-sitter-c" 501 + "tree-sitter-comment" 502 + "tree-sitter-fortran" 503 + "tree-sitter-hcl" 504 + "tree-sitter-hyprlang" 505 + "tree-sitter-llvm" 506 + "tree-sitter-markdown" 507 + "tree-sitter-query" 508 + "tree-sitter-rust" 509 + ]; 510 + pinnedGrammarsJson = jsonFile pinnedGrammars; 511 + 497 512 allGrammars = 498 513 let 499 514 treeSitterOrgaGrammars = lib.listToAttrs ( ··· 523 538 inherit 524 539 knownTreeSitterOrgGrammarRepos 525 540 ignoredTreeSitterOrgRepos 541 + pinnedGrammars 526 542 ; 527 543 } 528 544 (
+4
pkgs/development/tools/parsing/tree-sitter/update_impl.py
··· 96 96 "outputDir": outputDir, 97 97 "nixRepoAttrName": nixRepoAttrName, 98 98 }: 99 + if repo in args["pinnedGrammars"]: 100 + log(f"Grammar {repo} is pinned, skipping upgrade...") 101 + return 102 + 99 103 token: str | None = os.environ.get("GITHUB_TOKEN", None) 100 104 out = run_cmd( 101 105 curl_github_args(