]>
Commit | Line | Data |
---|---|---|
b50e5110 | 1 | # |
f7cd7b16 | 2 | # Conditional build: |
b50e5110 | 3 | %bcond_without doc # Sphinx documentation |
9101e20c | 4 | %bcond_with tests # unit tests |
f7cd7b16 | 5 | |
b50e5110 JB |
6 | Summary: Python tool that checks if a module satisfy a coding standard |
7 | Summary(pl.UTF-8): Narzędzie Pythona sprawdzające zgodność modułu ze standardem kodowania | |
baeb5efa | 8 | Name: pylint |
fdba9144 | 9 | Version: 2.15.2 |
987f14f4 | 10 | Release: 2 |
e6bafd81 | 11 | License: GPL v2+ |
baeb5efa | 12 | Group: Development/Languages/Python |
9101e20c | 13 | #Source0Download: https://pypi.org/simple/pylint/ |
966cfc11 | 14 | Source0: https://github.com/PyCQA/pylint/archive/v%{version}/%{name}-%{version}.tar.gz |
fdba9144 | 15 | # Source0-md5: 02a41a1ea1576d89614f6b2cffff48f6 |
b9af353d | 16 | URL: https://www.pylint.org/ |
fdba9144 JB |
17 | BuildRequires: python3-devel >= 1:3.7.2 |
18 | BuildRequires: python3-modules >= 1:3.7.2 | |
19 | BuildRequires: python3-setuptools >= 1:62.6 | |
f8bbbbb3 | 20 | %if %{with tests} || %{with doc} |
fdba9144 JB |
21 | BuildRequires: python3-astroid >= 2.12.9 |
22 | BuildRequires: python3-astroid < 2.14 | |
23 | BuildRequires: python3-dill >= 0.2 | |
9101e20c | 24 | BuildRequires: python3-isort >= 4.2.5 |
b9af353d | 25 | BuildRequires: python3-isort < 6 |
9101e20c | 26 | BuildRequires: python3-mccabe >= 0.6 |
fdba9144 | 27 | BuildRequires: python3-mccabe < 0.8 |
966cfc11 | 28 | BuildRequires: python3-platformdirs >= 2.2.0 |
fdba9144 JB |
29 | %if "%{_ver_lt '%{py3_ver}' '3.11'}" == "1" |
30 | BuildRequires: python3-tomli >= 1.1.0 | |
31 | %endif | |
32 | BuildRequires: python3-tomlkit >= 0.10.1 | |
33 | %if "%{_ver_lt '%{py3_ver}' '3.10'}" == "1" | |
b9af353d JB |
34 | BuildRequires: python3-typing_extensions >= 3.10.0 |
35 | %endif | |
fdba9144 | 36 | %endif |
b9af353d JB |
37 | %if %{with tests} |
38 | BuildRequires: python3-pytest | |
9101e20c | 39 | %endif |
2ae24f33 | 40 | BuildRequires: rpm-pythonprov |
fdba9144 | 41 | BuildRequires: rpmbuild(macros) >= 1.749 |
9101e20c | 42 | %if %{with doc} |
fdba9144 JB |
43 | BuildRequires: python3-furo >= 2021.9 |
44 | # >= 2022.6.21 when available | |
45 | #BuildRequires: python3-myst_parser >= 0.18 | |
46 | BuildRequires: python3-myst_parser < 1 | |
47 | BuildRequires: python3-sphinx_reredirects < 1 | |
48 | BuildRequires: sphinx-pdg-3 >= 4.5 | |
49 | # >= 5.1.1 when available | |
9101e20c | 50 | %endif |
b50e5110 | 51 | Requires: py3lint = %{version}-%{release} |
baeb5efa | 52 | BuildArch: noarch |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
b50e5110 | 56 | Python tool that checks if a module satisfy a coding standard. |
baeb5efa | 57 | |
65b81fbb | 58 | %description -l pl.UTF-8 |
b50e5110 | 59 | Narzędzie Pythona sprawdzające zgodność modułów napisanych w języku |
df0ba447 | 60 | Python z regułami tworzenia kodu źródłowego. |
345b7a9d | 61 | |
704b7472 | 62 | %package -n py3lint |
df0ba447 JB |
63 | Summary: Python 3 tool that checks if a module satisfy a coding standard |
64 | Summary(pl.UTF-8): Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania | |
f7cd7b16 | 65 | Group: Development/Languages/Python |
345b7a9d | 66 | Requires: python3-pylint = %{version}-%{release} |
704b7472 | 67 | Obsoletes: pylint-python3 < 1.0.0-2 |
f7cd7b16 | 68 | |
704b7472 | 69 | %description -n py3lint |
df0ba447 | 70 | Python 3 tool that checks if a module satisfy a coding standard. |
f7cd7b16 JK |
71 | |
72 | Python 3.x version, available via the 'py3lint' command. | |
73 | ||
704b7472 | 74 | %description -n py3lint -l pl.UTF-8 |
df0ba447 JB |
75 | Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku |
76 | Python z regułami tworzenia kodu źródłowego. | |
f7cd7b16 JK |
77 | |
78 | Wersja dla Pythona 3.x, dostępna przez polecenie 'py3lint'. | |
79 | ||
345b7a9d | 80 | %package -n python3-pylint |
df0ba447 JB |
81 | Summary: Python 3 tool that checks if a module satisfy a coding standard (moduły) |
82 | Summary(pl.UTF-8): Narzędzie Pythona 3 sprawdzające zgodność modułu ze standardem kodowania (modules) | |
345b7a9d | 83 | Group: Libraries/Python |
fdba9144 | 84 | Requires: python3-modules >= 1:3.7.2 |
345b7a9d JK |
85 | |
86 | %description -n python3-pylint | |
df0ba447 | 87 | Python 3 tool that checks if a module satisfy a coding standard. |
345b7a9d | 88 | |
df0ba447 | 89 | This package contains only the Python modules used by the tool. |
345b7a9d JK |
90 | |
91 | %description -n python3-pylint -l pl.UTF-8 | |
df0ba447 JB |
92 | Narzędzie Pythona 3 sprawdzające zgodność modułów napisanych w języku |
93 | Python z regułami tworzenia kodu źródłowego. | |
345b7a9d | 94 | |
df0ba447 | 95 | Ten pakiet zawiera tylko moduły Pythona używane przez to narzędzie. |
345b7a9d | 96 | |
9101e20c JB |
97 | %package doc |
98 | Summary: Documentation for pylint | |
99 | Summary(pl.UTF-8): Dokumentacja do pylinta | |
100 | Group: Documentation | |
101 | ||
102 | %description doc | |
103 | Documentation for pylint. | |
104 | ||
105 | %description doc -l pl.UTF-8 | |
106 | Dokumentacja do pylinta. | |
107 | ||
baeb5efa | 108 | %prep |
966cfc11 | 109 | %setup -q |
8b70ac82 | 110 | |
fdba9144 JB |
111 | # stub for setuptools |
112 | cat >setup.py <<EOF | |
113 | from setuptools import setup | |
114 | setup() | |
115 | EOF | |
116 | ||
987f14f4 JB |
117 | # disable errors on warnings caused by unreachable network |
118 | %{__sed} -i -e '/ALLSPHINXOPTS/ s/ -W / /' doc/Makefile | |
119 | ||
baeb5efa | 120 | %build |
15bfcc2d | 121 | %py3_build |
baeb5efa | 122 | |
e0de7fee | 123 | %if %{with doc} |
fdba9144 | 124 | %{__make} -C doc build-html \ |
b9af353d JB |
125 | PYTHONPATH=$PWD \ |
126 | SPHINXBUILD=sphinx-build-3 | |
e0de7fee | 127 | %endif |
ad173d2e | 128 | |
baeb5efa | 129 | %install |
704b7472 | 130 | rm -rf $RPM_BUILD_ROOT |
966cfc11 | 131 | install -d $RPM_BUILD_ROOT%{_sysconfdir} |
baeb5efa | 132 | |
15bfcc2d | 133 | %py3_install |
4efaa76d | 134 | |
fdba9144 | 135 | for tool in epylint pylint pylint-config pyreverse symilar ; do |
b50e5110 JB |
136 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/${tool} $RPM_BUILD_ROOT%{_bindir}/${tool}-3 |
137 | ln -s ${tool}-3 $RPM_BUILD_ROOT%{_bindir}/${tool} | |
b50e5110 JB |
138 | done |
139 | # old PLD package compatibility | |
140 | ln -s epylint-3 $RPM_BUILD_ROOT%{_bindir}/epy3lint | |
141 | ln -s pylint-3 $RPM_BUILD_ROOT%{_bindir}/py3lint | |
142 | ln -s pyreverse-3 $RPM_BUILD_ROOT%{_bindir}/py3reverse | |
f7cd7b16 | 143 | |
704b7472 | 144 | cp -p examples/pylintrc $RPM_BUILD_ROOT%{_sysconfdir}/pylintrc |
baeb5efa | 145 | |
146 | %clean | |
147 | rm -rf $RPM_BUILD_ROOT | |
148 | ||
149 | %files | |
150 | %defattr(644,root,root,755) | |
ebaa5e6b | 151 | %attr(755,root,root) %{_bindir}/epylint |
7c199dbc | 152 | %attr(755,root,root) %{_bindir}/pylint |
fdba9144 | 153 | %attr(755,root,root) %{_bindir}/pylint-config |
ebaa5e6b | 154 | %attr(755,root,root) %{_bindir}/pyreverse |
7c199dbc | 155 | %attr(755,root,root) %{_bindir}/symilar |
7c199dbc | 156 | |
704b7472 | 157 | %files -n py3lint |
f7cd7b16 | 158 | %defattr(644,root,root,755) |
b50e5110 JB |
159 | %attr(755,root,root) %{_bindir}/epylint-3 |
160 | %attr(755,root,root) %{_bindir}/pylint-3 | |
fdba9144 | 161 | %attr(755,root,root) %{_bindir}/pylint-config-3 |
b50e5110 JB |
162 | %attr(755,root,root) %{_bindir}/pyreverse-3 |
163 | %attr(755,root,root) %{_bindir}/symilar-3 | |
f7cd7b16 JK |
164 | %attr(755,root,root) %{_bindir}/epy3lint |
165 | %attr(755,root,root) %{_bindir}/py3lint | |
166 | %attr(755,root,root) %{_bindir}/py3reverse | |
704b7472 | 167 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/pylintrc |
f7cd7b16 | 168 | |
345b7a9d JK |
169 | %files -n python3-pylint |
170 | %defattr(644,root,root,755) | |
fdba9144 | 171 | %doc CONTRIBUTORS.txt README.rst examples |
345b7a9d JK |
172 | %{py3_sitescriptdir}/pylint |
173 | %{py3_sitescriptdir}/pylint-%{version}-py*.egg-info | |
9101e20c JB |
174 | |
175 | %if %{with doc} | |
176 | %files doc | |
177 | %defattr(644,root,root,755) | |
fdba9144 | 178 | %doc doc/_build/html/* |
9101e20c | 179 | %endif |