Name: python-tree-sitter-javascript Version: 0.25.0 Release: 1%{?dist} Summary: JavaScript grammar for tree-sitter, Python binding License: MIT URL: https://github.com/tree-sitter/tree-sitter-javascript Source0: %{pypi_source tree_sitter_javascript} BuildRequires: python3-devel BuildRequires: gcc # The binding links Fedora's grammar library instead of compiling the # bundled parser.c and scanner.c. BuildRequires: pkgconfig(tree-sitter-javascript) >= 0.25 BuildRequires: python3-tree-sitter %global _description %{expand: The JavaScript (and JSX) grammar for the tree-sitter parsing library, packaged as the tree_sitter_javascript Python module, along with its highlighting, locals and tags queries. Use it with the tree_sitter Python bindings.} %description %{_description} %package -n python3-tree-sitter-javascript Summary: %{summary} Requires: python3-tree-sitter %description -n python3-tree-sitter-javascript %{_description} %prep %autosetup -n tree_sitter_javascript-%{version} rm src/parser.c src/scanner.c sed -i \ -e '/^ "src\/parser.c",$/d' \ -e 's/^\(\s*\)name="_binding",/&\n\1libraries=["tree-sitter-javascript"],/' \ setup.py grep -q 'libraries=\["tree-sitter-javascript"\]' setup.py ! grep -q 'src/parser.c' setup.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l tree_sitter_javascript %check %pyproject_check_import %{py3_test_envvars} %{python3} - <<'PYEOF' import tree_sitter_javascript as tsjs from tree_sitter import Language, Parser, Query, QueryCursor lang = Language(tsjs.language()) tree = Parser(lang).parse(b"class A { #x = a?.b; async f() { for await (const y of z) {} } }") assert not tree.root_node.has_error, tree.root_node q = Query(lang, tsjs.HIGHLIGHTS_QUERY) assert QueryCursor(q).captures(tree.root_node) PYEOF %files -n python3-tree-sitter-javascript -f %{pyproject_files} %doc README.md %changelog * Sun Nov 01 2026 Morgan Hough - 0.25.0-1 - Initial package