%global commit 3b9f936a30d6c929d2538437cdc0465fa521b8f3 %global shortcommit %{sub %commit 1 7} %global commitdate 20241204 Name: python-pegen Version: 0.3.0^%{commitdate}git%{shortcommit} Release: %autorelease Summary: CPython's PEG parser generator License: MIT URL: https://github.com/we-like-parsers/pegen Source: %{url}/archive/%{commit}/pegen-%{shortcommit}.tar.gz # Python 3.14 support Patch: https://github.com/we-like-parsers/pegen/pull/112.patch BuildArch: noarch BuildRequires: python3-devel # Build dependencies BuildRequires: python3dist(pip) BuildRequires: python3dist(psutil) BuildRequires: python3dist(setuptools) BuildRequires: python3dist(setuptools-scm) # Test dependency BuildRequires: python3dist(pytest) BuildRequires: python3-test # Documentation dependencies BuildRequires: python3dist(furo) BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx-copybutton) # Additional documentation dependencies BuildRequires: make BuildRequires: texinfo BuildRequires: python3dist(docutils) %global _description %{expand: Pegen is the parser generator used in CPython to produce the parser used by the interpreter. It allows to produce PEG parsers from a description of a formal Grammar.} %description %_description %package -n python3-pegen Summary: %{summary} %description -n python3-pegen %_description %pyproject_extras_subpkg -n python3-pegen docs,lint,memory,test,web %prep %autosetup -p1 -n pegen-%{commit} export SETUPTOOLS_SCM_PRETEND_VERSION=0.3.0 # pep517 build not supported, build dependencies listed manually # package orphaned in Fedora # https://src.fedoraproject.org/rpms/python-pep517 #generate_buildrequires #pyproject_buildrequires -x docs,memory %build export SETUPTOOLS_SCM_PRETEND_VERSION=0.3.0 %pyproject_wheel pushd docs sphinx-build -b texinfo . texinfo pushd texinfo makeinfo --docbook pegen.texi popd popd %install %pyproject_install %pyproject_save_files -l pegen mkdir -p %{buildroot}%{_datadir}/help/en/python-pegen install -m644 docs/texinfo/pegen.xml %{buildroot}%{_datadir}/help/en/python-pegen cp -p -r docs/texinfo/pegen-figures %{buildroot}%{_datadir}/help/en/python-pegen/ %check %pyproject_check_import -t %pytest tests %files -n python3-pegen -f %{pyproject_files} %doc README.md %dir %{_datadir}/help/en %lang(en) %{_datadir}/help/en/python-pegen %changelog %autochangelog