3 %bcond_with tests # do perform tests (broken in 4.2.15)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: Python utility / library to sort imports alphabetically
13 Group: Libraries/Python
14 Source0: https://files.pythonhosted.org/packages/source/i/%{module}/%{module}-%{version}.tar.gz
15 # Source0-md5: 34915a2ce60e6fe3dbcbf5982deef9b4
16 URL: https://github.com/timothycrosley/isort
17 BuildRequires: rpm-pythonprov
18 BuildRequires: rpmbuild(macros) >= 1.714
20 BuildRequires: python-setuptools
23 BuildRequires: python3-setuptools
25 Requires: python-modules
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 isort is a Python utility / library to sort imports alphabetically,
31 and automatically separated into sections. It provides a command line
32 utility, Python library and plugins for various editors to quickly
33 sort all your imports. It currently cleanly supports Python 2.7 - 3.6
34 without any dependencies.
36 %package -n python3-%{module}
37 Summary: Python utility / library to sort imports alphabetically
38 Group: Libraries/Python
39 Requires: python3-modules
41 %description -n python3-%{module}
42 isort is a Python utility / library to sort imports alphabetically,
43 and automatically separated into sections. It provides a command line
44 utility, Python library and plugins for various editors to quickly
45 sort all your imports. It currently cleanly supports Python 2.7 - 3.6
46 without any dependencies.
49 Summary: Python utility / library to sort imports alphabetically
50 Group: Development/Tools
52 Requires: python3-%{module} = %{version}-%{release}
54 Requires: python-%{module} = %{version}-%{release}
58 isort is a Python utility / library to sort imports alphabetically,
59 and automatically separated into sections. It provides a command line
60 utility, Python library and plugins for various editors to quickly
61 sort all your imports. It currently cleanly supports Python 2.7 - 3.6
62 without any dependencies.
65 %setup -q -n %{module}-%{version}
69 %py_build %{?with_tests:test}
73 %py3_build %{?with_tests:test}
77 rm -rf $RPM_BUILD_ROOT
82 # when files are installed in other way that standard 'setup.py
83 # they need to be (re-)compiled
84 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
85 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
86 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
96 rm -rf $RPM_BUILD_ROOT
100 %defattr(644,root,root,755)
101 %doc ACKNOWLEDGEMENTS.md CHANGELOG.md README.rst
102 %{py_sitescriptdir}/%{module}
103 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
107 %files -n python3-%{module}
108 %defattr(644,root,root,755)
109 %doc ACKNOWLEDGEMENTS.md CHANGELOG.md README.rst
110 %{py3_sitescriptdir}/%{module}
111 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
115 %defattr(644,root,root,755)
116 %attr(755,root,root) %{_bindir}/isort