Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-xgrammar for openSUSE:Factory
checked in at 2026-07-24 00:43:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-xgrammar (Old)
and /work/SRC/openSUSE:Factory/.python-xgrammar.new.2004 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xgrammar"
Fri Jul 24 00:43:02 2026 rev:2 rq:1367538 version:0.2.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-xgrammar/python-xgrammar.changes
2026-07-15 16:55:45.155241101 +0200
+++
/work/SRC/openSUSE:Factory/.python-xgrammar.new.2004/python-xgrammar.changes
2026-07-24 00:43:08.839254204 +0200
@@ -1,0 +2,29 @@
+Thu Jul 23 19:52:52 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 0.2.5:
+ * Add a Lark grammar frontend.
+ * Store FSM end states sparsely, removing quadratic memory use
+ during FSM construction.
+ * Prevent XML whitespace state explosion.
+- Changes from 0.2.4:
+ * Support whitespace control for structural tags.
+ * Make JSON Schema "multipleOf" sound for integers and warn for
+ numbers; reject unsupported overlapping "oneOf" schemas.
+ * Fix tool_choice="required" structural tags to terminate instead
+ of looping.
+ * Fix a "\S" regex escape wrongly rejecting a literal "[".
+ * Warn when apply_token_bitmask_inplace leaves logits unmasked due
+ to an undersized bitmask.
+ * Deduplicate identical repetition expansions and resolve FSM trie
+ back edges via Aho-Corasick failure links.
+- Switch the source to a git-tag tarball generated via _service:
+ upstream no longer ships an sdist on PyPI and the C++ build needs
+ the bundled 3rdparty submodules.
+- Temporarily tolerate the transformers ImportError in the %%check
+ smoke test: Factory currently ships python-transformers 5.14.1
+ (which caps tokenizers<=0.23.0) alongside python-tokenizers 0.23.1,
+ so "import transformers" is broken distro-wide. The native C++
+ binding is still asserted to load; drop this guard once the
+ transformers/tokenizers skew is resolved in Factory.
+
+-------------------------------------------------------------------
Old:
----
xgrammar-0.2.3.tar.gz
New:
----
_service
xgrammar-0.2.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-xgrammar.spec ++++++
--- /var/tmp/diff_new_pack.JoxLR1/_old 2026-07-24 00:43:10.203301838 +0200
+++ /var/tmp/diff_new_pack.JoxLR1/_new 2026-07-24 00:43:10.207301977 +0200
@@ -17,12 +17,15 @@
%{?sle15_python_module_pythons}
Name: python-xgrammar
-Version: 0.2.3
+Version: 0.2.5
Release: 0
Summary: Efficient, Flexible and Portable Structured Generation
License: Apache-2.0
URL: https://xgrammar.mlc.ai/
-Source:
https://files.pythonhosted.org/packages/source/x/xgrammar/xgrammar-%{version}.tar.gz
+# Upstream stopped publishing an sdist on PyPI; the tarball is generated from
+# the git tag via _service because the C++ build needs the 3rdparty submodules.
+# https://github.com/mlc-ai/xgrammar
+Source: xgrammar-%{version}.tar.gz
BuildRequires: %{python_module apache-tvm-ffi >= 0.1.9}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy}
@@ -76,10 +79,44 @@
%check
# The upstream pytest suite downloads tokenizer models from HuggingFace, so it
-# is not runnable in the build root. A bare `import xgrammar` pulls in torch,
-# transformers and the compiled tvm_ffi binding, exercising that the C++
-# extension loads and links against apache-tvm-ffi correctly.
-%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -Bc "import
xgrammar; from xgrammar import Grammar, GrammarCompiler, CompiledGrammar;
assert Grammar is not None"
+# is not runnable in the build root. Importing xgrammar loads the compiled
+# tvm_ffi binding first (exercising that the C++ extension builds, loads and
+# links against apache-tvm-ffi correctly) before importing the public API.
+#
+# TEMPORARY: Factory ships python-transformers 5.14.1 (which caps
+# tokenizers<=0.23.0) alongside python-tokenizers 0.23.1, so `import
+# transformers` -- reached via xgrammar's tokenizer_info -- raises ImportError
+# distro-wide. That import happens *after* the native binding is loaded, so we
+# tolerate only that specific ImportError and still assert the C++ extension
+# loaded. Drop this guard once the transformers/tokenizers skew is fixed in
+# Factory.
+cat > smoketest.py <<'PYEOF'
+import sys
+
+try:
+ import xgrammar
+ from xgrammar import Grammar, GrammarCompiler, CompiledGrammar
+
+ assert Grammar is not None
+ assert GrammarCompiler is not None
+ assert CompiledGrammar is not None
+ print("xgrammar smoke test: full import OK")
+except ImportError as exc:
+ if "tokenizers" not in str(exc) and "transformers" not in str(exc):
+ raise
+ # xgrammar/__init__ imports load_binding (native xgrammar_bindings) before
+ # the transformers-dependent tokenizer_info, so the compiled extension is
+ # already loaded even though the top-level import aborted.
+ lb = sys.modules.get("xgrammar.load_binding")
+ assert lb is not None and getattr(lb, "LIB", None) is not None, (
+ "native xgrammar_bindings failed to load"
+ )
+ print(
+ "xgrammar native C++ binding loaded OK; transformers-dependent import "
+ "skipped due to Factory transformers<=0.23.0 / tokenizers 0.23.1 skew"
+ )
+PYEOF
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -B
smoketest.py
%files %{python_files}
%license LICENSE NOTICE
++++++ _service ++++++
<services>
<service name="obs_scm" mode="manual">
<param name="url">https://github.com/mlc-ai/xgrammar.git</param>
<param name="scm">git</param>
<param name="revision">v0.2.5</param>
<param name="version">0.2.5</param>
<param name="versionformat">0.2.5</param>
<param name="submodules">enable</param>
<param name="filename">xgrammar</param>
</service>
<service name="tar" mode="manual"/>
<service name="recompress" mode="manual">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="manual"/>
</services>
++++++ xgrammar-0.2.3.tar.gz -> xgrammar-0.2.5.tar.gz ++++++
++++ 9838 lines of diff (skipped)