[packages/python-lark] - initial

qboosh qboosh at pld-linux.org
Fri Oct 31 17:52:11 CET 2025


commit 3ab47f6765a6d48a9005f0a7a04505eb5057534e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Oct 31 17:52:02 2025 +0100

    - initial

 python-lark.spec | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 237 insertions(+)
---
diff --git a/python-lark.spec b/python-lark.spec
new file mode 100644
index 0000000..de5354b
--- /dev/null
+++ b/python-lark.spec
@@ -0,0 +1,237 @@
+#
+# Conditional build:
+%bcond_with	doc	# Sphinx documentation (broken with current sphinx-gallery)
+%bcond_without	tests	# unit tests
+%bcond_without	python2 # CPython 2.x module
+%bcond_with	python3 # CPython 3.x module (built from python3-lark.spec)
+
+Summary:	Modern parsing library
+Summary(pl.UTF-8):	Nowoczesna biblioteka parsująca
+Name:		python-lark
+# keep 0.x here for python2 support
+Version:	0.12.0
+Release:	1
+License:	MIT
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/lark/
+Source0:	https://files.pythonhosted.org/packages/source/l/lark/lark-%{version}.tar.gz
+# Source0-md5:	7f64473684945e0ba069b065d3d64cce
+URL:		https://pypi.org/project/lark/
+%if %{with python2}
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-regex
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules >= 1:3.2
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-regex
+%endif
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	python3-recommonmark
+BuildRequires:	python3-sphinx_gallery
+BuildRequires:	python3-sphinx_markdown_tables
+BuildRequires:	python3-sphinx_rtd_theme
+# sphinx_markdown_tables extension not available for sphinx-pdg-2
+BuildRequires:	sphinx-pdg-3
+%endif
+Requires:	python-modules >= 1:2.7
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Lark is a modern general-purpose parsing library for Python.
+
+With Lark, you can parse any context-free grammar, efficiently, with
+very little code.
+
+Main Features:
+- Builds a parse-tree (AST) automagically, based on the structure of
+  the grammar
+- Earley parser
+  - Can parse all context-free grammars
+  - Full support for ambiguous grammars
+- LALR(1) parser
+  - Fast and light, competitive with PLY
+  - Can generate a stand-alone parser
+- CYK parser, for highly ambiguous grammars
+- EBNF grammar
+- Unicode fully supported
+- Python 2 & 3 compatible
+- Automatic line & column tracking
+- Standard library of terminals (strings, numbers, names, etc.)
+- Import grammars from Nearley.js
+- Extensive test suite
+
+%description -l pl.UTF-8
+Lark to nowoczesna biblioteka parsująca ogólnego przeznaczenia dla
+Pythona.
+
+Przy użyciu Larka można analizować dowolną gramatykę bezkontekstową w
+sposób wydajny, przy użyciu małej ilości kodu.
+
+Główne możliwości:
+- automatyczne tworzenie drzewa składniowego (AST) w oparciu o
+  strukturę gramatyki
+- parser Earleya
+  - może analizować wszystkie gramatyki bezkontekstowe
+  - pełna obsługa gramatyk niejednoznacznych
+- parser LALR(1)
+  - szybki i lekki, konkurencyjny dla PLY
+  - może generować samodzielne analizatory
+- parser CYK dla bardzo niejednoznacznych gramatyk
+- gramatyki EBNF
+- pełna obsługa Unicode
+- zgodność z Pythonem 2 i 3
+- automatyczne śledzenie wierszy i kolumn
+- standardowa biblioteka symboli końcowych (łańcuchów, liczb, nazw
+  itp.)
+- importowanie gramatyk z Nearley.js
+- obszerny zestaw testów
+
+%package -n python3-lark
+Summary:	Modern parsing library
+Summary(pl.UTF-8):	Nowoczesna biblioteka parsująca
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.2
+
+%description -n python3-lark
+Lark is a modern general-purpose parsing library for Python.
+
+With Lark, you can parse any context-free grammar, efficiently, with
+very little code.
+
+Main Features:
+- Builds a parse-tree (AST) automagically, based on the structure of
+  the grammar
+- Earley parser
+  - Can parse all context-free grammars
+  - Full support for ambiguous grammars
+- LALR(1) parser
+  - Fast and light, competitive with PLY
+  - Can generate a stand-alone parser
+- CYK parser, for highly ambiguous grammars
+- EBNF grammar
+- Unicode fully supported
+- Python 2 & 3 compatible
+- Automatic line & column tracking
+- Standard library of terminals (strings, numbers, names, etc.)
+- Import grammars from Nearley.js
+- Extensive test suite
+- And much more!
+
+%description -n python3-lark -l pl.UTF-8
+Lark to nowoczesna biblioteka parsująca ogólnego przeznaczenia dla
+Pythona.
+
+Przy użyciu Larka można analizować dowolną gramatykę bezkontekstową w
+sposób wydajny, przy użyciu małej ilości kodu.
+
+Główne możliwości:
+- automatyczne tworzenie drzewa składniowego (AST) w oparciu o
+  strukturę gramatyki
+- parser Earleya
+  - może analizować wszystkie gramatyki bezkontekstowe
+  - pełna obsługa gramatyk niejednoznacznych
+- parser LALR(1)
+  - szybki i lekki, konkurencyjny dla PLY
+  - może generować samodzielne analizatory
+- parser CYK dla bardzo niejednoznacznych gramatyk
+- gramatyki EBNF
+- pełna obsługa Unicode
+- zgodność z Pythonem 2 i 3
+- automatyczne śledzenie wierszy i kolumn
+- standardowa biblioteka symboli końcowych (łańcuchów, liczb, nazw
+  itp.)
+- importowanie gramatyk z Nearley.js
+- obszerny zestaw testów
+
+%package apidocs
+Summary:	API documentation for Python lark module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona lark
+Group:		Documentation
+
+%description apidocs
+API documentation for Python lark module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona lark.
+
+%prep
+%setup -q -n lark-%{version}
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+%{__python} -m tests
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+%{__python3} -m tests
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C docs html \
+	SPHINXBUILD=sphinx-build-3
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python-lark-%{version}
+cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-lark-%{version}
+%endif
+
+%if %{with python3}
+%py3_install
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-lark-%{version}
+cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-lark-%{version}
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README.md
+%{py_sitescriptdir}/lark
+%{py_sitescriptdir}/lark-stubs
+%{py_sitescriptdir}/lark-%{version}-py*.egg-info
+%{_examplesdir}/python-lark-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-lark
+%defattr(644,root,root,755)
+%doc LICENSE README.md
+%{py3_sitescriptdir}/lark
+%{py3_sitescriptdir}/lark-stubs
+%{py3_sitescriptdir}/lark-%{version}-py*.egg-info
+%{_examplesdir}/python3-lark-%{version}
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_downloads,_images,_static,examples,*.html,*.js}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-lark.git/commitdiff/3ab47f6765a6d48a9005f0a7a04505eb5057534e



More information about the pld-cvs-commit mailing list