3 %bcond_with tests # unit tests (needs more dependencies in PLD)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: Python 2 library to sort imports alphabetically
9 Summary(pl.UTF-8): Narzędzie Pythona 2 do alfabetycznego sortowania listy importów
10 Name: python-%{module}
11 # keep 4.x here for python2 support
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/isort/
17 Source0: https://files.pythonhosted.org/packages/source/i/isort/%{module}-%{version}.tar.gz
18 # Source0-md5: 05d66f2eb7ce2c2d702e86bac24bf9e4
19 URL: https://github.com/timothycrosley/isort
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-modules >= 1:2.7
24 BuildRequires: python-setuptools
26 BuildRequires: python-backports.functools_lru_cache
27 BuildRequires: python-futures
28 BuildRequires: python-pip-api
29 BuildRequires: python-pipreqs
30 BuildRequires: python-pytest
31 BuildRequires: python-requirementslib
35 BuildRequires: python3-modules >= 1:3.4
36 BuildRequires: python3-setuptools
38 BuildRequires: python3-pip-api
39 BuildRequires: python3-pipreqs
40 BuildRequires: python3-pytest
41 BuildRequires: python3-requirementslib
44 Requires: python-modules >= 1:2.7
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 isort is a Python utility / library to sort imports alphabetically,
50 and automatically separated into sections. It provides a command line
51 utility, Python library and plugins for various editors to quickly
52 sort all your imports. It currently cleanly supports Python 2.7 and
53 3.4+ without any dependencies.
55 This package contains Python 2 library.
57 %description -l pl.UTF-8
58 isort to pythonowe narzędzie/biblioteka do alfabetycznego sortowania
59 importów i automatycznego dzielenia ich na sekcje. Udostępnia
60 narzędzie wiersza poleceń, bibliotekę Pythona i wtyczki do różnych
61 edytorów, pozwalające szybko posortować importy. Obecnie obsługuje
62 czysto wersje Pythona 2.7 i 3.4+ bez zewnętrznych zależności.
64 Ten pakiet zawiera bibliotekę Pythona 2.
66 %package -n python3-%{module}
67 Summary: Python 3 library to sort imports alphabetically
68 Summary(pl.UTF-8): Biblioteka Pythona 3 do alfabetycznego sortowania listy importów
69 Group: Libraries/Python
70 Requires: python3-modules >= 1:3.4
72 %description -n python3-%{module}
73 isort is a Python utility / library to sort imports alphabetically,
74 and automatically separated into sections. It provides a command line
75 utility, Python library and plugins for various editors to quickly
76 sort all your imports. It currently cleanly supports Python 2.7 and
77 3.4+ without any dependencies.
79 This package contains Python 3 library.
81 %description -n python3-%{module} -l pl.UTF-8
82 isort to pythonowe narzędzie/biblioteka do alfabetycznego sortowania
83 importów i automatycznego dzielenia ich na sekcje. Udostępnia
84 narzędzie wiersza poleceń, bibliotekę Pythona i wtyczki do różnych
85 edytorów, pozwalające szybko posortować importy. Obecnie obsługuje
86 czysto wersje Pythona 2.7 i 3.4+ bez zewnętrznych zależności.
88 Ten pakiet zawiera bibliotekę Pythona 3.
91 Summary: Python utility to sort imports alphabetically
92 Summary(pl.UTF-8): Pythonowe narzędzie do alfabetycznego sortowania listy importów
93 Group: Development/Tools
95 Requires: python3-%{module} = %{version}-%{release}
97 Requires: python-%{module} = %{version}-%{release}
100 %description -n isort
101 isort is a Python utility / library to sort imports alphabetically,
102 and automatically separated into sections. It provides a command line
103 utility, Python library and plugins for various editors to quickly
104 sort all your imports. It currently cleanly supports Python 2.7 and
105 3.4+ without any dependencies.
107 This package contains command line utility.
109 %description -n isort -l pl.UTF-8
110 isort to pythonowe narzędzie/biblioteka do alfabetycznego sortowania
111 importów i automatycznego dzielenia ich na sekcje. Udostępnia
112 narzędzie wiersza poleceń, bibliotekę Pythona i wtyczki do różnych
113 edytorów, pozwalające szybko posortować importy. Obecnie obsługuje
114 czysto wersje Pythona 2.7 i 3.4+ bez zewnętrznych zależności.
116 Ten pakiet zawiera narzędzie wiersza poleceń.
119 %setup -q -n %{module}-%{version}
126 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
127 %{__python} -m pytest test_isort.py
135 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
136 %{__python3} -m pytest test_isort.py
141 rm -rf $RPM_BUILD_ROOT
154 rm -rf $RPM_BUILD_ROOT
158 %defattr(644,root,root,755)
159 %doc ACKNOWLEDGEMENTS.md CHANGELOG.md LICENSE README.rst
160 %{py_sitescriptdir}/%{module}
161 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
165 %files -n python3-%{module}
166 %defattr(644,root,root,755)
167 %doc ACKNOWLEDGEMENTS.md CHANGELOG.md LICENSE README.rst
168 %{py3_sitescriptdir}/%{module}
169 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{_bindir}/isort