%global pypi_name crashtest %global common_description %{expand: Crashtest is a Python library that makes exceptions handling and inspection easier.} Name: python-%{pypi_name} Version: 0.3.1 Release: 1%{?dist} Summary: Manage Python errors with ease License: MIT URL: https://github.com/sdispater/crashtest # The sdist has setup.py and hence can be built without poetry (which requires crashtest) Source0: %{pypi_source} # OTOH the GitHub tarball has tests, but needs poetry Source1: %{url}/archive/%{version}/%{pypi_name}-%{version}-git.tar.gz # Build with bootstrap uses setuptools instead of poetry %bcond_with bootstrap BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: pyproject-rpm-macros %description %{common_description} %package -n python3-%{pypi_name} %py_provides python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{common_description} %prep %autosetup -b1 -n %{pypi_name}-%{version} -p1 %if %{with bootstrap} rm pyproject.toml %else rm setup.py %endif %generate_buildrequires %pyproject_buildrequires -r %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check %pytest %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Sat Oct 03 2020 Fabio Valentini - 0.3.1-1 - Initial package