python3.14-ply/python3.14-ply.spec
Charalampos Stratakis e2d4ae9860 Update to the latest and last upstream commit
Use modern pyproject macros

Related: RHEL-120807
2026-02-12 14:17:56 +01:00

103 lines
3.2 KiB
RPMSpec

%global python3_pkgversion 3.14
%global modname ply
%global commit 9d7c40099e23ff78f9d86ef69a26c1e8a83e706a
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global commitdate 20251221
%bcond_without tests
Name: python%{python3_pkgversion}-%{modname}
Summary: Python Lex-Yacc
Version: 3.11^%{commitdate}git%{shortcommit}
Release: 1%{?dist}
License: BSD-3-Clause
URL: http://www.dabeaz.com/ply/
Source0: https://github.com/dabeaz/ply/archive/%{commit}/%{modname}-%{shortcommit}.tar.gz
BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel
%description
PLY is a straightforward lex/yacc implementation. Here is a list of its
essential features:
* It is implemented entirely in Python.
* It uses LR-parsing which is reasonably efficient and well suited for larger
grammars.
* PLY provides most of the standard lex/yacc features including support
for empty productions, precedence rules, error recovery, and support
for ambiguous grammars.
* PLY is straightforward to use and provides very extensive error checking.
* PLY doesn't try to do anything more or less than provide the basic lex/yacc
functionality. In other words, it's not a large parsing framework or a
component of some larger system.
%prep
%autosetup -n %{modname}-%{commit} -p1
# Remove unnecessary wheel build dependency
sed -i 's/, "wheel"//' pyproject.toml
find example/ -type f -executable -exec chmod -x {} ';'
find example/ -type f -name '*.py' -exec sed -i \
-e '1{\@^#!/usr/bin/env python@d}' -e '1{\@^#!/usr/local/bin/python@d}' \
{} ';'
# extract license block from src/ply/lex.py
sed -n '2,/^# ---/{ /^# ---/d; s/^# \?//p }' src/ply/lex.py > LICENSE
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l %{modname}
%if %{with tests}
%check
export PYTHONPATH=$PWD/src
pushd tests
./cleanup.sh
%{__python3} testlex.py
%{__python3} testyacc.py
popd
%endif
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
%doc CHANGES README.md
%license LICENSE
%changelog
* Fri Jan 09 2026 Charalampos Stratakis <cstratak@redhat.com> - 3.11^20251221git9d7c400-1
- Update to the latest and last upstream commit
- The project won't have any new releases
- Use modern pyproject macros
Related: RHEL-120807
* Thu Sep 04 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11-29
- Initial package
Fedora contributions by:
Dennis Gilmore <dennis@ausil.us>
Bill Nottingham <notting@fedoraproject.org>
Charalampos Stratakis <cstratak@redhat.com>
Christian Heimes <cheimes@redhat.com>
David Malcolm <dmalcolm@redhat.com>
Ignacio Vazquez-Abrams <ivazquez@fedoraproject.org>
Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Jesse Keating <jkeating@fedoraproject.org>
Miro Hrončok <miro@hroncok.cz>
Orion Poplawski <orion@cora.nwra.com>
Patrik Kopkan <pkopkan@redhat.com>
Rob Crittenden <rcritten@redhat.com>
Robert Kuska <rkuska@redhat.com>
Slavek Kabrda <bkabrda@redhat.com>
Stephen Gallagher <sgallagh@redhat.com>
Thomas Spura <tomspur@fedoraproject.org>
Tom Callaway <spot@fedoraproject.org>
Troy Dawson <tdawson@redhat.com>