%global commit 29c353a795b6c44f67b6221ca2ae28c388b5030f %global shortcommit 29c353a %global commitdate 20250318 Name: python-pyformlang Version: 1.0.11 Release: %autorelease Summary: A python framework for formal grammars License: MIT URL: https://github.com/Aunsiels/pyformlang Source0: %{url}/archive/%{commit}/pyformlang-%{shortcommit}.tar.gz # Needed to build documentation Source1: https://docs.python.org/3/objects.inv # Prevent error when genereting docbook # https://github.com/numpy/numpy/issues/12278 # https://github.com/numpy/numpy/issues/12278 # https://github.com/sphinx-doc/sphinx/issues/10371 Patch: builddocs.patch BuildArch: noarch BuildRequires: python3-devel # Tests BuildRequires: python3dist(pytest) # Documentation BuildRequires: make BuildRequires: texinfo BuildRequires: python3dist(docutils) BuildRequires: python3dist(networkx) BuildRequires: python3dist(numpy) BuildRequires: python3dist(numpydoc) BuildRequires: python3dist(pycodestyle) BuildREquires: python3dist(pydot) BuildRequires: python3dist(sphinx) BuildRequires: python3-sphinx_rtd_theme %global _description %{expand: A python library to manipulate formal grammar. In general, it can be used to better understand algorithms in a formal way.} %description %_description %package -n python3-pyformlang Summary: %{summary} %description -n python3-pyformlang %_description %prep %autosetup -p1 -n pyformlang-%{commit} # Prevent error in generating documentation using Sphinx sed -i "s|{'https://docs.python.org/': None}|{'python': ('https://docs.python.org/3', 'objects.inv')}|g" doc/conf.py cp %{SOURCE1} doc/ %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel pushd doc make texinfo pushd _build pushd texinfo makeinfo --docbook pyformlang.texi popd popd popd %install %pyproject_install %pyproject_save_files -l pyformlang mkdir -p %{buildroot}%{_datadir}/help/en/pyformlang install -m644 doc/_build/texinfo/pyformlang.xml %{buildroot}%{_datadir}/help/en/pyformlang %check %pyproject_check_import %pytest %files -n python3-pyformlang -f %{pyproject_files} %dir %{_datadir}/help/en %lang(en) %{_datadir}/help/en/pyformlang %changelog %autochangelog