2020-04-15 14:44:04 +00:00
|
|
|
%global modname isort
|
|
|
|
|
|
|
|
Name: python-%{modname}
|
|
|
|
Version: 4.3.21
|
|
|
|
Release: 7%{?dist}
|
|
|
|
Summary: Python utility / library to sort Python imports
|
|
|
|
|
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/timothycrosley/%{modname}
|
|
|
|
Source0: %{url}/archive/%{version}-2/%{modname}-%{version}-2.tar.gz
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: pyproject-rpm-macros
|
|
|
|
|
|
|
|
%description
|
|
|
|
This package contains executables.
|
2020-08-04 11:08:46 +00:00
|
|
|
Building this tests that executables are not listed when +auto is not used
|
2020-04-15 14:44:04 +00:00
|
|
|
with %%pyproject_save_files.
|
|
|
|
|
2023-06-01 07:26:42 +00:00
|
|
|
This package also uses %%{python3_pkgversion} in name and has a very limited
|
2024-01-25 16:08:50 +00:00
|
|
|
set of dependencies -- allows to set a different value for it repeatedly.
|
2023-06-01 07:26:42 +00:00
|
|
|
|
|
|
|
%package -n python%{python3_pkgversion}-%{modname}
|
2020-04-15 14:44:04 +00:00
|
|
|
Summary: %{summary}
|
|
|
|
|
2023-06-01 07:26:42 +00:00
|
|
|
%description -n python%{python3_pkgversion}-%{modname}
|
2020-04-15 14:44:04 +00:00
|
|
|
%{summary}.
|
|
|
|
|
2024-01-25 16:08:50 +00:00
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
%global python3_pkgversion 3.11
|
|
|
|
%package -n python%{python3_pkgversion}-%{modname}
|
|
|
|
Summary: %{summary}
|
|
|
|
|
|
|
|
%description -n python%{python3_pkgversion}-%{modname}
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
%global python3_pkgversion 3.12
|
|
|
|
%package -n python%{python3_pkgversion}-%{modname}
|
|
|
|
Summary: %{summary}
|
|
|
|
|
|
|
|
%description -n python%{python3_pkgversion}-%{modname}
|
|
|
|
%{summary}.
|
|
|
|
|
|
|
|
%global python3_pkgversion 3
|
|
|
|
%endif
|
|
|
|
|
2020-04-15 14:44:04 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n %{modname}-%{version}-2
|
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
2022-01-14 15:26:40 +00:00
|
|
|
%pyproject_buildrequires
|
2024-01-25 16:08:50 +00:00
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
%global python3_pkgversion 3.11
|
|
|
|
%pyproject_buildrequires
|
|
|
|
%global python3_pkgversion 3.12
|
|
|
|
%pyproject_buildrequires
|
|
|
|
%global python3_pkgversion 3
|
|
|
|
%endif
|
|
|
|
|
2020-04-15 14:44:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%pyproject_wheel
|
2024-01-25 16:08:50 +00:00
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
%global python3_pkgversion 3.11
|
|
|
|
%pyproject_wheel
|
|
|
|
%global python3_pkgversion 3.12
|
|
|
|
%pyproject_wheel
|
|
|
|
%global python3_pkgversion 3
|
|
|
|
%endif
|
2020-04-15 14:44:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
%install
|
2024-01-25 16:08:50 +00:00
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
%global python3_pkgversion 3.11
|
|
|
|
%pyproject_install
|
|
|
|
%pyproject_save_files -l isort
|
|
|
|
%global python3_pkgversion 3.12
|
|
|
|
%pyproject_install
|
|
|
|
%pyproject_save_files -l isort
|
|
|
|
%global python3_pkgversion 3
|
|
|
|
%endif
|
|
|
|
# we keep this one last so /usr/bin/isort is installed with python3 shebang
|
2020-04-15 14:44:04 +00:00
|
|
|
%pyproject_install
|
2023-09-27 12:37:15 +00:00
|
|
|
%pyproject_save_files -l isort
|
2020-04-15 14:44:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
# Internal check if the instalation outputs expected result
|
|
|
|
test -d %{buildroot}%{python3_sitelib}/%{modname}/
|
|
|
|
test -d %{buildroot}%{python3_sitelib}/%{modname}-%{version}.dist-info/
|
|
|
|
|
2020-08-04 11:08:46 +00:00
|
|
|
# Internal check that executables are not present when +auto was not used with %%pyproject_save_files
|
2022-04-06 11:36:26 +00:00
|
|
|
grep -F %{_bindir}/%{modname} %{pyproject_files} && exit 1 || true
|
2020-04-15 14:44:04 +00:00
|
|
|
|
2024-01-25 16:08:50 +00:00
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
# Internal check that correct versions are in correct %%{pyproject_files}s
|
|
|
|
diff %{pyproject_files} <(grep -F python3.9/site-packages %{pyproject_files})
|
|
|
|
|
|
|
|
%global python3_pkgversion 3.11
|
|
|
|
test -d %{buildroot}%{_usr}/lib/python3.11/site-packages/%{modname}/
|
|
|
|
test -d %{buildroot}%{_usr}/lib/python3.11/site-packages/%{modname}-%{version}.dist-info/
|
|
|
|
diff %{pyproject_files} <(grep -F python3.11/site-packages %{pyproject_files})
|
|
|
|
|
|
|
|
%global python3_pkgversion 3.12
|
|
|
|
test -d %{buildroot}%{_usr}/lib/python3.12/site-packages/%{modname}/
|
|
|
|
test -d %{buildroot}%{_usr}/lib/python3.12/site-packages/%{modname}-%{version}.dist-info/
|
|
|
|
diff %{pyproject_files} <(grep -F python3.12/site-packages %{pyproject_files})
|
|
|
|
%global python3_pkgversion 3
|
|
|
|
%endif
|
|
|
|
|
2020-04-15 14:44:04 +00:00
|
|
|
|
2023-06-01 07:26:42 +00:00
|
|
|
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
|
2020-04-15 14:44:04 +00:00
|
|
|
%doc README.rst *.md
|
|
|
|
%{_bindir}/%{modname}
|
2024-01-25 16:08:50 +00:00
|
|
|
%if 0%{?rhel} == 9
|
|
|
|
%global python3_pkgversion 3.11
|
|
|
|
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
|
|
|
|
%doc README.rst *.md
|
|
|
|
%global python3_pkgversion 3.12
|
|
|
|
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
|
|
|
|
%doc README.rst *.md
|
|
|
|
%global python3_pkgversion 3
|
|
|
|
%endif
|