]>
Commit | Line | Data |
---|---|---|
db818afa JK |
1 | # |
2 | # Conditional build: | |
4525bd44 | 3 | %bcond_with tests # unit tests (needs more dependencies in PLD) |
db818afa JK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module isort | |
4525bd44 JB |
8 | Summary: Python 2 library to sort imports alphabetically |
9 | Summary(pl.UTF-8): Narzędzie Pythona 2 do alfabetycznego sortowania listy importów | |
db818afa | 10 | Name: python-%{module} |
4e728d1e | 11 | # keep 4.x here for python2 support |
4525bd44 | 12 | Version: 4.3.21 |
66167cb4 | 13 | Release: 6 |
db818afa JK |
14 | License: MIT |
15 | Group: Libraries/Python | |
4525bd44 JB |
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 | |
db818afa JK |
19 | URL: https://github.com/timothycrosley/isort |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
4525bd44 | 23 | BuildRequires: python-modules >= 1:2.7 |
db818afa | 24 | BuildRequires: python-setuptools |
4525bd44 JB |
25 | %if %{with tests} |
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 | |
32 | %endif | |
db818afa JK |
33 | %endif |
34 | %if %{with python3} | |
4525bd44 | 35 | BuildRequires: python3-modules >= 1:3.4 |
db818afa | 36 | BuildRequires: python3-setuptools |
4525bd44 JB |
37 | %if %{with tests} |
38 | BuildRequires: python3-pip-api | |
39 | BuildRequires: python3-pipreqs | |
40 | BuildRequires: python3-pytest | |
41 | BuildRequires: python3-requirementslib | |
42 | %endif | |
db818afa | 43 | %endif |
4525bd44 | 44 | Requires: python-modules >= 1:2.7 |
db818afa JK |
45 | BuildArch: noarch |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
47 | ||
48 | %description | |
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 | |
4525bd44 JB |
52 | sort all your imports. It currently cleanly supports Python 2.7 and |
53 | 3.4+ without any dependencies. | |
54 | ||
55 | This package contains Python 2 library. | |
56 | ||
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. | |
63 | ||
64 | Ten pakiet zawiera bibliotekę Pythona 2. | |
db818afa JK |
65 | |
66 | %package -n python3-%{module} | |
4525bd44 JB |
67 | Summary: Python 3 library to sort imports alphabetically |
68 | Summary(pl.UTF-8): Biblioteka Pythona 3 do alfabetycznego sortowania listy importów | |
db818afa | 69 | Group: Libraries/Python |
4525bd44 | 70 | Requires: python3-modules >= 1:3.4 |
db818afa JK |
71 | |
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 | |
4525bd44 JB |
76 | sort all your imports. It currently cleanly supports Python 2.7 and |
77 | 3.4+ without any dependencies. | |
78 | ||
79 | This package contains Python 3 library. | |
80 | ||
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. | |
87 | ||
88 | Ten pakiet zawiera bibliotekę Pythona 3. | |
db818afa JK |
89 | |
90 | %package -n isort | |
4525bd44 JB |
91 | Summary: Python utility to sort imports alphabetically |
92 | Summary(pl.UTF-8): Pythonowe narzędzie do alfabetycznego sortowania listy importów | |
db818afa JK |
93 | Group: Development/Tools |
94 | %if %{with python3} | |
95 | Requires: python3-%{module} = %{version}-%{release} | |
96 | %else | |
97 | Requires: python-%{module} = %{version}-%{release} | |
98 | %endif | |
99 | ||
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 | |
4525bd44 JB |
104 | sort all your imports. It currently cleanly supports Python 2.7 and |
105 | 3.4+ without any dependencies. | |
106 | ||
107 | This package contains command line utility. | |
108 | ||
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. | |
115 | ||
116 | Ten pakiet zawiera narzędzie wiersza poleceń. | |
db818afa JK |
117 | |
118 | %prep | |
119 | %setup -q -n %{module}-%{version} | |
120 | ||
121 | %build | |
122 | %if %{with python2} | |
4525bd44 JB |
123 | %py_build |
124 | ||
125 | %if %{with tests} | |
4e728d1e | 126 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
4525bd44 JB |
127 | %{__python} -m pytest test_isort.py |
128 | %endif | |
db818afa JK |
129 | %endif |
130 | ||
131 | %if %{with python3} | |
4525bd44 JB |
132 | %py3_build |
133 | ||
134 | %if %{with tests} | |
4e728d1e | 135 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
4525bd44 JB |
136 | %{__python3} -m pytest test_isort.py |
137 | %endif | |
db818afa JK |
138 | %endif |
139 | ||
140 | %install | |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
143 | %if %{with python2} | |
144 | %py_install | |
145 | ||
db818afa JK |
146 | %py_postclean |
147 | %endif | |
148 | ||
149 | %if %{with python3} | |
150 | %py3_install | |
151 | %endif | |
152 | ||
153 | %clean | |
154 | rm -rf $RPM_BUILD_ROOT | |
155 | ||
156 | %if %{with python2} | |
157 | %files | |
158 | %defattr(644,root,root,755) | |
4525bd44 | 159 | %doc ACKNOWLEDGEMENTS.md CHANGELOG.md LICENSE README.rst |
db818afa JK |
160 | %{py_sitescriptdir}/%{module} |
161 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
162 | %endif | |
163 | ||
164 | %if %{with python3} | |
165 | %files -n python3-%{module} | |
166 | %defattr(644,root,root,755) | |
4525bd44 | 167 | %doc ACKNOWLEDGEMENTS.md CHANGELOG.md LICENSE README.rst |
db818afa JK |
168 | %{py3_sitescriptdir}/%{module} |
169 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
170 | %endif | |
171 | ||
172 | %files -n isort | |
173 | %defattr(644,root,root,755) | |
174 | %attr(755,root,root) %{_bindir}/isort |