2800b49
%global modname isort
2800b49
2800b49
Name:               python-%{modname}
2800b49
Version:            4.3.21
2800b49
Release:            7%{?dist}
2800b49
Summary:            Python utility / library to sort Python imports
2800b49
2800b49
License:            MIT
2800b49
URL:                https://github.com/timothycrosley/%{modname}
2800b49
Source0:            %{url}/archive/%{version}-2/%{modname}-%{version}-2.tar.gz
2800b49
BuildArch:          noarch
e928128
BuildRequires:      python3-devel
2800b49
BuildRequires:      pyproject-rpm-macros
2800b49
2800b49
%description
2800b49
This package contains executables.
5809bbc
Building this tests that executables are not listed when +auto is not used
2800b49
with %%pyproject_save_files.
2800b49
2800b49
%package -n python3-%{modname}
2800b49
Summary:            %{summary}
2800b49
2800b49
%description -n python3-%{modname}
2800b49
%{summary}.
2800b49
2800b49
2800b49
%prep
2800b49
%autosetup -n %{modname}-%{version}-2
2800b49
2800b49
2800b49
%generate_buildrequires
8c8afba
%pyproject_buildrequires
2800b49
2800b49
2800b49
%build
2800b49
%pyproject_wheel
2800b49
2800b49
2800b49
%install
2800b49
%pyproject_install
2800b49
%pyproject_save_files isort
2800b49
2800b49
2800b49
%check
2800b49
# Internal check if the instalation outputs expected result
2800b49
test -d %{buildroot}%{python3_sitelib}/%{modname}/
2800b49
test -d %{buildroot}%{python3_sitelib}/%{modname}-%{version}.dist-info/
2800b49
5809bbc
# Internal check that executables are not present when +auto was not used with %%pyproject_save_files
6015300
grep -F %{_bindir}/%{modname} %{pyproject_files} && exit 1 || true
2800b49
2800b49
2800b49
%files -n python3-%{modname} -f %{pyproject_files}
2800b49
%doc README.rst *.md
2800b49
%license LICENSE
2800b49
%{_bindir}/%{modname}