Macro cleanup

- Drop srcname and pkgname macros, just use the values in the appropriate places
- Remove test conditional (always run tests)
This commit is contained in:
Carl George 2023-01-30 14:58:16 -06:00
parent 8f9b392ad2
commit b6a736f0f8

View File

@ -1,43 +1,33 @@
# what it's called on pypi
%global srcname prompt_toolkit
# package name fragment
%global pkgname prompt-toolkit
%global common_description %{expand:
prompt_toolkit is a library for building powerful interactive command line
applications in Python.}
%bcond_without tests
Name: python-%{pkgname}
Name: python-prompt-toolkit
Version: 3.0.36
Release: 1%{?dist}
Summary: Library for building powerful interactive command line applications in Python
License: BSD
URL: https://github.com/prompt-toolkit/python-prompt-toolkit
Source0: %pypi_source
Source: %{pypi_source prompt_toolkit}
BuildArch: noarch
%description %{common_description}
%package -n python3-%{pkgname}
%package -n python3-prompt-toolkit
Summary: %{summary}
BuildRequires: python3-devel
%if %{with tests}
BuildRequires: python3-pytest
%endif
# https://github.com/jonathanslenders/python-prompt-toolkit/issues/94
Recommends: python3-pygments
%description -n python3-%{pkgname} %{common_description}
%description -n python3-prompt-toolkit %{common_description}
%prep
%autosetup -n %{srcname}-%{version}
%autosetup -n prompt_toolkit-%{version}
%generate_buildrequires
@ -50,16 +40,14 @@ Recommends: python3-pygments
%install
%pyproject_install
%pyproject_save_files %{srcname}
%pyproject_save_files prompt_toolkit
%if %{with tests}
%check
%pytest
%endif
%files -n python3-%{pkgname} -f %{pyproject_files}
%files -n python3-prompt-toolkit -f %{pyproject_files}
%doc README.rst AUTHORS.rst CHANGELOG