]>
Commit | Line | Data |
---|---|---|
e541e8cd | 1 | # |
f7cd7b16 | 2 | # Conditional build: |
e541e8cd JB |
3 | %bcond_without python2 # Python 2.x version (available as 'py2lint') |
4 | %bcond_with python3 # Python 3.x version (available as 'py3lint') | |
5 | %bcond_without doc # Sphinx documentation | |
f7cd7b16 | 6 | |
df0ba447 JB |
7 | Summary: Python 2 tool that checks if a module satisfy a coding standard |
8 | Summary(pl.UTF-8): Narzędzie Pythona 2 sprawdzające zgodność modułu ze standardem kodowania | |
e541e8cd JB |
9 | Name: python-pylint |
10 | Version: 1.9.5 | |
11 | Release: 1 | |
e6bafd81 | 12 | License: GPL v2+ |
baeb5efa | 13 | Group: Development/Languages/Python |
e541e8cd JB |
14 | #Source0Download: https://pypi.org/simple/pylint |
15 | Source0: https://github.com/PyCQA/pylint/archive/pylint-%{version}.tar.gz | |
16 | # Source0-md5: 3db0fde1876d50ad313fd707ecd6562b | |
17 | Patch0: %{name}-rc.patch | |
ad173d2e | 18 | URL: http://www.pylint.org/ |
f7cd7b16 | 19 | %if %{with python2} |
e541e8cd JB |
20 | BuildRequires: python-devel >= 1:2.7 |
21 | BuildRequires: python-modules >= 1:2.7 | |
22 | BuildRequires: python-pytest-runner | |
71480d3a | 23 | BuildRequires: python-setuptools >= 7.0 |
e541e8cd JB |
24 | %if %{with tests} |
25 | BuildRequires: python-astroid >= 1.6.0 | |
26 | BuildRequires: python-astroid < 2.0 | |
27 | BuildRequires: python-backports.functools_lru_cache | |
28 | BuildRequires: python-configparser | |
29 | BuildRequires: python-isort >= 4.2.5 | |
30 | BuildRequires: python-mccabe | |
31 | BuildRequires: python-pytest | |
32 | BuildRequires: python-pytest-xdist | |
33 | BuildRequires: python-singledispatch | |
f7cd7b16 JK |
34 | %endif |
35 | %if %{with python3} | |
e541e8cd JB |
36 | BuildRequires: python3-devel >= 1:3.4 |
37 | BuildRequires: python3-modules >= 1:3.4 | |
38 | BuildRequires: python3-modules < 1:3.7 | |
39 | BuildRequires: python3-pytest-runner | |
71480d3a | 40 | BuildRequires: python3-setuptools >= 7.0 |
e541e8cd JB |
41 | %if %{with tests} |
42 | BuildRequires: python3-astroid >= 1.6.0 | |
43 | BuildRequires: python3-astroid < 2.0 | |
44 | BuildRequires: python3-isort >= 4.2.5 | |
45 | BuildRequires: python3-pytest | |
46 | BuildRequires: python3-pytest-xdist | |
47 | BuildRequires: python3-mccabe | |
48 | %endif | |
f7cd7b16 | 49 | %endif |
2ae24f33 | 50 | BuildRequires: rpm-pythonprov |
e541e8cd JB |
51 | BuildRequires: rpmbuild(macros) >= 1.714 |
52 | %if %{with doc} | |
53 | BuildRequires: sphinx-pdg >= 1 | |
54 | %endif | |
93850ade | 55 | Suggests: python-devel-src |
baeb5efa | 56 | BuildArch: noarch |
57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
58 | ||
59 | %description | |
df0ba447 | 60 | Python 2 tool that checks if a module satisfy a coding standard. |
baeb5efa | 61 | |
e541e8cd JB |
62 | This package contains only the Python modules used by the tool. |
63 | ||
65b81fbb | 64 | %description -l pl.UTF-8 |
df0ba447 JB |
65 | Narzędzie Pythona 2 sprawdzające zgodność modułów napisanych w języku |
66 | Python z regułami tworzenia kodu źródłowego. | |
c85c0a5a | 67 | |
e541e8cd JB |
68 | Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie. |
69 | ||
70 | %package -n py2lint | |
df0ba447 JB |
71 | Summary: Python 2 tool that checks if a module satisfy a coding standard (modules) |
72 | Summary(pl.UTF-8): Narzędzie Pythona sprawdzające zgodność modułu ze standardem kodowania (moduły) | |
345b7a9d | 73 | Group: Libraries/Python |
e541e8cd | 74 | Requires: %{name} = %{version}-%{release} |
345b7a9d | 75 | |
e541e8cd | 76 | %description -n py2lint |
df0ba447 | 77 | Python 2 tool that checks if a module satisfy a coding standard. |
345b7a9d | 78 | |
e541e8cd JB |
79 | %description -n py2lint -l pl.UTF-8 |
80 | Narzędzie Pythona 2 sprawdzające zgodność modułów napisanych w języku | |
81 | Python z regułami tworzenia kodu źródłowego. | |
82 | ||
83 | %package -n python3-pylint | |
84 | Summary: Python 3 tool that checks if a module satisfy a coding standard (moduły) | |
85 | Summary(pl.UTF-8): Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania (modules) | |
86 | Group: Libraries/Python | |
87 | ||
88 | %description -n python3-pylint | |
89 | Python 3 tool that checks if a module satisfy a coding standard. | |
90 | ||
df0ba447 | 91 | This package contains only the Python modules used by the tool. |
345b7a9d | 92 | |
e541e8cd JB |
93 | %description -n python3-pylint -l pl.UTF-8 |
94 | Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku | |
df0ba447 | 95 | Python z regułami tworzenia kodu źródłowego. |
345b7a9d | 96 | |
df0ba447 | 97 | Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie. |
345b7a9d | 98 | |
704b7472 | 99 | %package -n py3lint |
df0ba447 JB |
100 | Summary: Python 3 tool that checks if a module satisfy a coding standard |
101 | Summary(pl.UTF-8): Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania | |
f7cd7b16 | 102 | Group: Development/Languages/Python |
345b7a9d | 103 | Requires: python3-pylint = %{version}-%{release} |
704b7472 | 104 | Obsoletes: pylint-python3 < 1.0.0-2 |
f7cd7b16 | 105 | |
704b7472 | 106 | %description -n py3lint |
df0ba447 | 107 | Python 3 tool that checks if a module satisfy a coding standard. |
f7cd7b16 JK |
108 | |
109 | Python 3.x version, available via the 'py3lint' command. | |
110 | ||
704b7472 | 111 | %description -n py3lint -l pl.UTF-8 |
df0ba447 JB |
112 | Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku |
113 | Python z regułami tworzenia kodu źródłowego. | |
f7cd7b16 JK |
114 | |
115 | Wersja dla Pythona 3.x, dostępna przez polecenie 'py3lint'. | |
116 | ||
e541e8cd JB |
117 | %package doc |
118 | Summary: Documentation for pylint module and tool | |
119 | Summary(pl.UTF-8): Dokumentacja do modułu i narzędzia pylint | |
120 | Group: Documentation | |
345b7a9d | 121 | |
e541e8cd JB |
122 | %description doc |
123 | Documentation for pylint module and tool. | |
345b7a9d | 124 | |
e541e8cd JB |
125 | %description doc -l pl.UTF-8 |
126 | Dokumentacja do modułu i narzędzia pylint. | |
345b7a9d | 127 | |
baeb5efa | 128 | %prep |
19641c03 | 129 | %setup -q -n pylint-pylint-%{version} |
e541e8cd | 130 | %patch0 -p1 |
8b70ac82 | 131 | |
baeb5efa | 132 | %build |
f7cd7b16 | 133 | %if %{with python2} |
15bfcc2d | 134 | %py_build |
f7cd7b16 JK |
135 | %endif |
136 | ||
137 | %if %{with python3} | |
15bfcc2d | 138 | %py3_build |
f7cd7b16 | 139 | %endif |
baeb5efa | 140 | |
e541e8cd | 141 | %if %{with doc} |
e1ce958c | 142 | %{__make} -C doc text \ |
15bfcc2d | 143 | PYTHONPATH=$PWD |
e541e8cd | 144 | %endif |
ad173d2e | 145 | |
baeb5efa | 146 | %install |
704b7472 | 147 | rm -rf $RPM_BUILD_ROOT |
4ec6f79e | 148 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} |
baeb5efa | 149 | |
f7cd7b16 | 150 | %if %{with python2} |
15bfcc2d | 151 | %py_install |
7c199dbc | 152 | %py_postclean |
e541e8cd JB |
153 | |
154 | for tool in epylint pylint pyreverse symilar ; do | |
155 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/${tool} $RPM_BUILD_ROOT%{_bindir}/${tool}-2 | |
156 | cp -p man/${tool}.1 $RPM_BUILD_ROOT%{_mandir}/man1/${tool}-2.1 | |
157 | done | |
158 | ||
159 | cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc-2 | |
f7cd7b16 JK |
160 | %endif |
161 | ||
e541e8cd JB |
162 | %if %{with python3} |
163 | %py3_install | |
164 | ||
165 | for tool in epylint pylint pyreverse symilar ; do | |
166 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/${tool} $RPM_BUILD_ROOT%{_bindir}/${tool}-3 | |
167 | cp -p man/${tool}.1 $RPM_BUILD_ROOT%{_mandir}/man1/${tool}-3.1 | |
168 | done | |
169 | # old PLD package compatibility | |
170 | ln -s epylint-3 $RPM_BUILD_ROOT%{_bindir}/epy3lint | |
171 | ln -s pylint-3 $RPM_BUILD_ROOT%{_bindir}/py3lint | |
172 | ln -s pyreverse-3 $RPM_BUILD_ROOT%{_bindir}/py3reverse | |
173 | echo '.so epylint-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/epy3lint.1 | |
174 | echo '.so pylint-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/py3lint.1 | |
175 | echo '.so pyreverse-3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/py3reverse.1 | |
176 | ||
177 | cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc-3 | |
178 | %endif | |
baeb5efa | 179 | |
180 | %clean | |
181 | rm -rf $RPM_BUILD_ROOT | |
182 | ||
f7cd7b16 | 183 | %if %{with python2} |
baeb5efa | 184 | %files |
185 | %defattr(644,root,root,755) | |
e541e8cd | 186 | %doc ChangeLog README.rst examples |
345b7a9d JK |
187 | %{py_sitescriptdir}/pylint |
188 | %{py_sitescriptdir}/pylint-%{version}-py*.egg-info | |
e541e8cd JB |
189 | |
190 | %files -n py2lint | |
191 | %defattr(644,root,root,755) | |
192 | %attr(755,root,root) %{_bindir}/epylint-2 | |
193 | %attr(755,root,root) %{_bindir}/pylint-2 | |
194 | %attr(755,root,root) %{_bindir}/pyreverse-2 | |
195 | %attr(755,root,root) %{_bindir}/symilar-2 | |
196 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc-2 | |
197 | %{_mandir}/man1/epylint-2.1* | |
198 | %{_mandir}/man1/pylint-2.1* | |
199 | %{_mandir}/man1/pyreverse-2.1* | |
200 | %{_mandir}/man1/symilar-2.1* | |
f7cd7b16 JK |
201 | %endif |
202 | ||
203 | %if %{with python3} | |
e541e8cd JB |
204 | %files -n python3-pylint |
205 | %defattr(644,root,root,755) | |
206 | %doc ChangeLog README.rst examples | |
207 | %{py3_sitescriptdir}/pylint | |
208 | %{py3_sitescriptdir}/pylint-%{version}-py*.egg-info | |
209 | ||
704b7472 | 210 | %files -n py3lint |
f7cd7b16 | 211 | %defattr(644,root,root,755) |
e541e8cd JB |
212 | %attr(755,root,root) %{_bindir}/epylint-3 |
213 | %attr(755,root,root) %{_bindir}/pylint-3 | |
214 | %attr(755,root,root) %{_bindir}/pyreverse-3 | |
215 | %attr(755,root,root) %{_bindir}/symilar-3 | |
f7cd7b16 JK |
216 | %attr(755,root,root) %{_bindir}/epy3lint |
217 | %attr(755,root,root) %{_bindir}/py3lint | |
218 | %attr(755,root,root) %{_bindir}/py3reverse | |
e541e8cd JB |
219 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc-3 |
220 | %{_mandir}/man1/epylint-3.1* | |
221 | %{_mandir}/man1/pylint-3.1* | |
222 | %{_mandir}/man1/pyreverse-3.1* | |
223 | %{_mandir}/man1/symilar-3.1* | |
f7cd7b16 JK |
224 | %{_mandir}/man1/epy3lint.1* |
225 | %{_mandir}/man1/py3lint.1* | |
226 | %{_mandir}/man1/py3reverse.1* | |
e541e8cd | 227 | %endif |
f7cd7b16 | 228 | |
e541e8cd JB |
229 | %if %{with doc} |
230 | %files doc | |
345b7a9d | 231 | %defattr(644,root,root,755) |
e541e8cd | 232 | %doc doc/_build/text/* |
f7cd7b16 | 233 | %endif |