https://bugzilla.redhat.com/show_bug.cgi?id=2280062
Ben Beasley code@musicinmybrain.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |code@musicinmybrain.net Doc Type|--- |If docs needed, set a value
--- Comment #6 from Ben Beasley code@musicinmybrain.net --- The output of pyp2rpm is unfortunately rather outdated. Among other issues, the License is not SPDX, there are macros that obfuscate rather than simplifying, and the spec file uses the “old” Python packaging guidelines https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_201x/ instead of https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/.
May I suggest something like the following? I’m happy to discuss details and provide documentation links.
Name: python-exrex Version: 0.11.0 Release: %autorelease Summary: Irregular methods for regular expressions
License: AGPL-3.0-or-later URL: https://github.com/asciimoo/exrex # We package from the GitHub archive since the PyPI sdist lacks tests. Source: %{url}/archive/v%{version}/exrex-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel BuildRequires: help2man
%global _description %{expand: Exrex is a command line tool and python module that generates all – or random – matching strings to a given regular expression and more.}
%description %{_description}
%package -n python3-exrex Summary: %{summary}
%description -n python3-exrex %{_description}
%prep %autosetup -n exrex-%{version}
%generate_buildrequires %pyproject_buildrequires -t
%build %pyproject_wheel
%install %pyproject_install %pyproject_save_files -l exrex
# Rely on the generated entry point %%{_bindir}/exrex; do not package # %%{_bindir}/exrex.py, which is a copy of the entire library. If something # needs to execute exrex.py, we can add a symbolic or hard link with than name # for compatibility. rm '%{buildroot}%{_bindir}/exrex.py'
# The site-packages module does not have executable permissions, so it should # not have a shebang line. sed -r -i '1{/^#!/d}' '%{buildroot}%{python3_sitelib}/exrex.py'
# We need to do this in %%install rather than in %%build so we can use the # %%{_bindir}/exrex entry point. install -d '%{buildroot}%{_mandir}/man1' PYTHONPATH='%{buildroot}%{python3_sitelib}' help2man \ --no-info \ --version-string='%{version}' \ --output='%{buildroot}%{_mandir}/man1/exrex.1' \ '%{buildroot}%{_bindir}/exrex'
%check %tox
%files -n python3-exrex -f %{pyproject_files} %doc README.md %{_bindir}/exrex %{_mandir}/man1/exrex.1*
%changelog %autochangelog