public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: git-commits@fedoraproject.org
Subject: [rpms/tree-sitter-yaml] rawhide: tree-sitter-yaml: Add Python bindings
Date: Mon, 19 Oct 2026 11:08:15 GMT	[thread overview]
Message-ID: <179240809513.1.15592610452797916359.rpms-tree-sitter-yaml-ca144b48df87@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/tree-sitter-yaml
            Branch : rawhide
            Commit : ca144b48df8729021850a3e6dd301d29d44a25b7
            Author : Maxime Ripard <mripard@kernel.org>
            Date   : 2026-10-19T11:45:26+02:00
            Stats  : +45/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/tree-sitter-yaml/c/ca144b48df8729021850a3e6dd301d29d44a25b7?branch=rawhide

            Log:
            tree-sitter-yaml: Add Python bindings

The py-tree-sitter package was recently merged into Fedora, and the
tree_sitter macro supports generating Python bindings for a tree-sitter
parser through the -P flag.

Pass it to generate the python3-tree-sitter-yaml subpackage.

Signed-off-by: Maxime Ripard <mripard@kernel.org>

---
diff --git a/0001-python-Drop-C-source-from-installed-package.patch b/0001-python-Drop-C-source-from-installed-package.patch
new file mode 100644
index 0000000..129491c
--- /dev/null
+++ b/0001-python-Drop-C-source-from-installed-package.patch
@@ -0,0 +1,43 @@
+From 769b3004569090cdcf27ef7d278ca51a4aa5403e Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <mripard@kernel.org>
+Date: Mon, 19 Oct 2026 11:21:02 +0200
+Subject: [PATCH] python: Drop C source from installed package
+
+Modern setuptools with pyproject.toml defaults to include_package_data=True,
+which includes all version-controlled files in package directories. Since
+binding.c lives inside the tree_sitter_yaml package directory, it gets
+installed alongside the compiled extension.
+
+This triggers rpmlint devel-file-in-non-devel-package warnings on distributions
+that lint for development files in runtime packages.
+
+Exclude *.c files from the installed package data. The C sources are still used
+as compilation inputs during the build, but are no longer shipped in the wheel
+or installed site-packages.
+
+Signed-off-by: Maxime Ripard <mripard@kernel.org>
+---
+ setup.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index 900806e5c7cb..6cb980731a6f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -49,10 +49,13 @@ setup(
+     package_dir={"": "bindings/python"},
+     package_data={
+         "tree_sitter_yaml": ["*.pyi", "py.typed"],
+         "tree_sitter_yaml.queries": ["*.scm"],
+     },
++    exclude_package_data={
++        "tree_sitter_yaml": ["*.c"],
++    },
+     ext_package="tree_sitter_yaml",
+     ext_modules=[
+         Extension(
+             name="_binding",
+             sources=[
+-- 
+2.55.0
+

diff --git a/tree-sitter-yaml.spec b/tree-sitter-yaml.spec
index 553b280..fa25445 100644
--- a/tree-sitter-yaml.spec
+++ b/tree-sitter-yaml.spec
@@ -6,9 +6,10 @@ URL:            https://github.com/tree-sitter-grammars/%{name}
 Source:         %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
 
 BuildRequires:  tree-sitter-srpm-macros >= 0.2.1
+Patch1:         0001-python-Drop-C-source-from-installed-package.patch
 BuildSystem:    tree_sitter
 
-%{tree_sitter -l YAML}
+%{tree_sitter -P -l YAML}
 
 %changelog
 %{autochangelog}

                 reply	other threads:[~2026-10-19 11:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179240809513.1.15592610452797916359.rpms-tree-sitter-yaml-ca144b48df87@fedoraproject.org \
    --to=mripard@kernel.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox