# # spec file for package python-lark # # Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define skip_python36 1 %define skip_python38 1 %define skip_python39 1 %define skip_python311 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 %{?sle15_python_module_pythons} Name: python-lark Version: 1.1.5 Release: 2.3 Summary: A parsing library for Python License: MIT Group: Development/Languages/Python URL: https://github.com/lark-parser/lark Source: https://github.com/lark-parser/lark/archive/%{version}.tar.gz#/lark-%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Suggests: python-regex Suggests: python-Js2Py Suggests: python-atomicwrites # SECTION TEST BuildRequires: %{python_module regex} BuildRequires: %{python_module Js2Py} BuildRequires: %{python_module pytest >= 6} # /SECTION BuildArch: noarch # Upstream renamed the package with v0.12.0, SUSE had the old name until 1.1.2 Provides: python-lark-parser = %{version}-%{release} Obsoletes: python-lark-parser <= 1.1.2 %python_subpackages %description Lark is a general-purpose parsing library for Python. With Lark, one can parse any context-free grammar with little code. %prep %setup -q -n lark-%{version} %build %python_build %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %pytest %files %{python_files} %license LICENSE %doc README.md docs/* %{python_sitelib}/lark %{python_sitelib}/lark-%{version}*-info %changelog * Fri Apr 21 2023 Dirk Müller - add sle15_python_module_pythons (jsc#PED-68) * Thu Apr 13 2023 Matej Cepl - Make calling of %%{sle15modernpython} optional. * Tue Dec 13 2022 Yogalakshmi Arunachalam - Update to v1.1.5 * What's Changed setup.cfg: Replace deprecated license_file with license_files by @mgorny in #1209 Fix Github shenanigans by @erezsh in #1220 Fix AmbiguousExpander (Issue #1214) by @chanicpanic in #1216 Fix EOF line information in InteractiveParser.resume_parse() by @erezsh in #1224 Use generator instead of list expand or add method by @jmishra01 in #1225 * Fri Dec 2 2022 Yogalakshmi Arunachalam - Update to v1.1.4 ci: Python 3.11 final by @henryiii in #1204 Add __all__ to __init__ by @aspizu in #1200 PropagatePositions: Allow any object to carry the metadata, by returning it in __lark_meta__() by @erezsh in #1203 fix: Token now pattern matches correctly by @marcinplatek in #1181 Updates to merge PR #1151 by @erezsh in #1205 style: pre-commit basic config by @henryiii in #1151 PR for v1.1.4 by @erezsh in #1208 * Fri Oct 28 2022 Yogalakshmi Arunachalam - Update to v1.1.3 Various fixes and refactors * Add user to cache filename; better handle cache load/save failures by @klauer in #1179 * refactor: add 'usedforsecurity=False' arg to hashlib.md5 usage by @cquick01 in #1190 * Create lark/grammars/init.py by @chanicpanic in #1171 * Adjust imports for Python 3.11 by @The-Compiler in #1140 * Fix for issue #1173 by @erezsh in #1198 * Add match stmt support to python.lark by @joseph-e-k in #1123 * Added match stmt support to python.lark by @MegaIng in #1016 * Linting to fix minor issues by @Erotemic in #1128 * Simplify lexer: Use Match.lastgroup instead of lastindex by @erezsh in #1129 * Fix confusing import in examples by @JonasLoos in #1138 * Move iter_subtrees_topdown into standalone by @camgunz in #1137 * Fix 1146: use the class's get instead of the instance's get by @MegaIng in #1147 * fix: remove Python 2 legacy packaging code by @henryiii in #1148 * Fix for PR #1149 by @erezsh in #1150 * Old link for sppf is no longer valid. Point to web archive instead. by @patrickhuber in #1159 * Fix ForestToPyDotVisitor by @chanicpanic in #1167 * Close file-like objects to address ResourceWarning. by @shawnbrown in #1183 * Minor adjustments to PR #1179 by @erezsh in #1189 * Adjustments for PR #1152 by @erezsh in #1191 * Remove trailing whitespace by @bcr in #1196 * Sun Oct 9 2022 Ben Greiner - Rename to python-lark - Update dependencies - Fix License identifier: LICENSE was changed 6 years ago * Thu Jul 14 2022 Johannes Kastl - BuildRequire pytest >= 6.0.0, to avoid '/home/abuild/rpmbuild/BUILD/lark-1.1.2/pytest.ini:2: requires pytest-6.0, actual pytest-3.10.1' * Tue May 24 2022 Alberto Planas Dominguez - Update to 1.1.2 * Tree instances now have a pretty print with the "rich" library, when doing rich.print(tree) * Bugfix for recursive regexes (with the "regex" library) * Refactors, cleanups, and better mypy support * Clean up tree templates implementation to reduce mypy errors * Remove redefinitions related to standalone parser * Added Tree.rich() method to make Tree a Rich renderable * Rename lexer_state->lexer_thread, and make a few adjustments for the benefit of Lark-Cython * Use isinstance() checks in expcetions match_examples() * change MAXREPEAT to int * Tests: Small fixes - For previous changes check https://github.com/lark-parser/lark/releases - Drop Python2 support * Wed May 26 2021 pgajdos@suse.com - version update to 0.11.3 * lot of changes, see https://github.com/lark-parser/lark/releases - removed sources * testdata.tar.gz (unneeded) - %%check: use %%pytest rpm macro * Fri Jul 3 2020 Antonio Larrosa - Update to 0.9.0 * Added error handling to LALR! + on_error option to Lark.parse(). + Parser now comes with a puppet for advanced error handling. * Support for better regexps with the regex module, when using Lark(..., regex=True) - Update to 0.8.9 * Bugfix for PyInstaller (2) (Fixing the last two releases) - Update to 0.8.8 * Reverted EOF commit due to unexpected problems. - Update to 0.8.7 * Bugfix for PyInstaller - Update to 0.8.6 * Grammar caching: It's now possible to cache the results of the LALR grammar analysis, for x2 to x3 faster loading. Use Lark(..., cache=True) or specify a file name. * Grammar templates: Added support for grammar "functions" that expand in preprocessing. * Lark online IDE: Technically not a feature, but it's possible to run Lark in the browser. Now we also have a simple IDE on github pages: https://lark-parser.github.io/lark/ide/app.html * Other changes: + Improved performance for large grammars + More debug prints when in debug mode + Better support for PyInstaller + Lots of bugfixes: mypy stubs, v_args, docs, and more. * Wed Apr 15 2020 Marketa Calabkova - Update to 0.8.5 * Updated js2py version (for the optional nearley support) * Added the g_regex_flags option, to allow applying flags to all terminals. * The standalone parser is now MPL2, instead of GPL. The Mozilla Public License is much less restrictive, so this shouldn't affect anyone who's already using the standalone parser. But it should make it easier for other users to adopt it. * The biggest change to this release is a new LALR engine, that is capable of dealing with a few edge cases that the previous parser couldn't. * Transformers now visit tokens, as well as rules (an alternative to lexer_callbacks) * Sun Oct 27 2019 Lars Vogdt - Update to 0.7.7: * Fixed a bug in Earley where running it from different threads produced bad results * Improved error reporting when using LALR * Added 'edit_terminals' option, to allow programmatical manipulation of terminals, for example to support keywords in different languages. * Wed Sep 11 2019 Tomáš Chvátal - Update to 0.7.5: * Lark transformers can now visit tokens as wel * Fixed long-standing non-determinism and prioritization bugs in Earley. * Serialize tool now supports multiple start symbols * iter_subtrees, find_data and find_pred methods are now included in standalone parser * Bugfixes for the transformer interface, for the custom lexer, for grammar imports, and many more * Mon Aug 26 2019 John Vandenberg - Drop no longer necessary disable_test.patch - Replace %%doc entry docs/ with docs/* to avoid extra sub-directory - Added Suggests: python-Js2Py for optional runtime dependency - Update to v0.7.3 * Added a new tool called Serialize, that stores Lark's internal state as JSON. That will allow for integration with other languages. * Minor bugfix regarding line-counting and the \s regex - from v0.7.2 * Lark now allows you to specify the start symbol when calling Lark.parse() (requires pre-declaration of all possible start states, see the start option) * Negative priority now allowed in rules and terminals * Also includes many minor bugfixes, optimizations, and improvements to documentation * Tue May 21 2019 pgajdos@suse.com - version update to 0.7.1 Lark can now serialize its parsers, resulting in simplified stand-alone code. Bugfix for v_args (Issue #350) Improvements and bugfixes for importing rules from grammar files Performance improvement for the reconstructor feature New Earley implementation with SPPF support Added support for importing rules between grammars. The import mechanism is namespace-aware. Added the maybe_placeholders option, which causes optionals of the form [expr] to return None when not matched, instead of just not appearing. (optionals of the form expr? maintain the previous behavior of not appearing unless matched) Plenty of bugfixes, better errors, and better docs * Thu Mar 14 2019 Jan Engelhardt - Trim bias from description. * Wed Mar 13 2019 Ondřej Súkup - initial commit - add disable_test.patch - skip test without needed data