[packages/tree-sitter-sql] - run python module load test
qboosh
qboosh at pld-linux.org
Tue Jan 27 09:58:40 CET 2026
commit 8bb43f3f33d2e719a52097ad9a4d13871979e89c
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Jan 27 09:58:49 2026 +0100
- run python module load test
tree-sitter-sql-python.patch | 11 +++++++++++
tree-sitter-sql.spec | 11 +++++++++++
2 files changed, 22 insertions(+)
---
diff --git a/tree-sitter-sql.spec b/tree-sitter-sql.spec
index 2f44cc5..755086a 100644
--- a/tree-sitter-sql.spec
+++ b/tree-sitter-sql.spec
@@ -1,6 +1,7 @@
#
# Conditional build:
%bcond_without python3 # Python 3.x binding
+%bcond_without tests # Python binding load test
Summary: SQL grammar for tree-sitter
Summary(pl.UTF-8): Gramatyka języka SQL dla tree-sittera
@@ -14,6 +15,7 @@ Source0: https://github.com/DerekStride/tree-sitter-sql/archive/v%{version}/%{na
# Source0-md5: 83ef00230672d05f47f52047c99e3038
Patch0: %{name}-js.patch
Patch1: %{name}-pc.patch
+Patch2: %{name}-python.patch
URL: https://github.com/DerekStride/tree-sitter-sql
# c11
BuildRequires: gcc >= 6:4.7
@@ -22,6 +24,9 @@ BuildRequires: tree-sitter-cli >= 0.26
BuildRequires: python3-devel >= 1:3.10
BuildRequires: python3-setuptools >= 1:42
BuildRequires: python3-wheel
+%if %{with tests}
+BuildRequires: python3-tree-sitter >= 0.24
+%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%endif
@@ -87,6 +92,7 @@ Analizator składni języka SQL dla Pythona.
%setup -q
%patch -P0 -p1
%patch -P1 -p1
+%patch -P2 -p1
%build
# update for tree-sitter 0.26
@@ -104,6 +110,11 @@ tree-sitter init --update
%if %{with python3}
%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(readlink -f build-3/lib.*) \
+%{__python3} -m unittest discover -s bindings/python/tests
+%endif
%endif
%install
diff --git a/tree-sitter-sql-python.patch b/tree-sitter-sql-python.patch
new file mode 100644
index 0000000..549618c
--- /dev/null
+++ b/tree-sitter-sql-python.patch
@@ -0,0 +1,11 @@
+--- tree-sitter-sql-0.3.11/bindings/python/tests/test_binding.py.orig 2026-01-27 09:48:37.699505996 +0100
++++ tree-sitter-sql-0.3.11/bindings/python/tests/test_binding.py 2026-01-27 09:52:08.315031661 +0100
+@@ -1,6 +1,7 @@
+ from unittest import TestCase
+
+-import tree_sitter, tree_sitter_sql
++import tree_sitter_sql
++from tree_sitter import Language, Parser
+
+
+ class TestLanguage(TestCase):
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/tree-sitter-sql.git/commitdiff/8bb43f3f33d2e719a52097ad9a4d13871979e89c
More information about the pld-cvs-commit
mailing list