]> git.pld-linux.org Git - packages/flake8.git/blob - flake8.spec
- added req patch: adjust entrypoints versions to be compatible with rpm dependency...
[packages/flake8.git] / flake8.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # pytest tests
6 %bcond_without  doc     # Sphinx documentation
7
8 Summary:        The modular source code checker: pycodestyle, pyflakes and co
9 Summary(pl.UTF-8):      Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
10 Name:           flake8
11 Version:        3.7.8
12 Release:        1
13 License:        MIT
14 Group:          Development/Tools
15 #Source0Download: https://pypi.org/simple/flake8/
16 Source0:        https://files.pythonhosted.org/packages/source/f/flake8/%{name}-%{version}.tar.gz
17 # Source0-md5:  147957dd7f8af16117ae5c3e6b82df74
18 Patch0:         %{name}-req.patch
19 URL:            https://gitlab.com/pycqa/flake8
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 BuildRequires:  rpm-pythonprov
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.7
24 BuildRequires:  python-setuptools >= 30
25 %if %{with tests}
26 BuildRequires:  python-configparser
27 BuildRequires:  python-entrypoints >= 0.3
28 BuildRequires:  python-entrypoints < 0.4
29 BuildRequires:  python-enum34
30 BuildRequires:  python-functools32
31 BuildRequires:  python-mccabe >= 0.6.0
32 BuildRequires:  python-mccabe < 0.7.0
33 BuildRequires:  python-mock >= 2.0.0
34 BuildRequires:  python-pycodestyle >= 2.5.0
35 BuildRequires:  python-pycodestyle < 2.6.0
36 BuildRequires:  python-pyflakes >= 2.1.0
37 BuildRequires:  python-pyflakes < 2.2.0
38 BuildRequires:  python-pytest
39 BuildRequires:  python-typing
40 %endif
41 %endif
42 %if %{with python3}
43 BuildRequires:  python3-modules >= 1:3.4
44 BuildRequires:  python3-setuptools >= 30
45 %if %{with tests}
46 BuildRequires:  python3-entrypoints >= 0.3
47 BuildRequires:  python3-entrypoints < 0.4
48 BuildRequires:  python3-mccabe >= 0.6.0
49 BuildRequires:  python3-mccabe < 0.7.0
50 BuildRequires:  python3-pycodestyle >= 2.5.0
51 BuildRequires:  python3-pycodestyle < 2.6.0
52 BuildRequires:  python3-pyflakes >= 2.1.0
53 BuildRequires:  python3-pyflakes < 2.2.0
54 BuildRequires:  python3-pytest
55 BuildRequires:  sed >= 4.0
56 %endif
57 %endif
58 %if %{with doc}
59 BuildRequires:  python3-sphinx-prompt
60 BuildRequires:  sphinx-pdg-3 >= 1.3
61 %endif
62 %if %{with python3}
63 Requires:       python3-flake8 = %{version}-%{release}
64 %else
65 Requires:       python-flake8 = %{version}-%{release}
66 %endif
67 BuildArch:      noarch
68 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69
70 %description
71 The modular source code checker. It is a wrapper around these tools:
72 - PyFlakes
73 - pycodestyle
74 - Ned Batchelder's McCabe script
75
76 %description -l pl.UTF-8
77 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
78 dla narzędzi:
79 - PyFlakes
80 - pycodestyle
81 - skrypt McCabe autorstwa Neda Batcheldera
82
83 %package -n python-flake8
84 Summary:        The modular source code checker: pycodestyle, pyflakes and co
85 Summary(pl.UTF-8):      Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
86 Group:          Libraries/Python
87 Requires:       python-modules >= 1:2.7
88
89 %description -n python-flake8
90 The modular source code checker. It is a wrapper around these tools:
91 - PyFlakes
92 - pycodestyle
93 - Ned Batchelder's McCabe script
94
95 %description -n python-flake8 -l pl.UTF-8
96 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
97 dla narzędzi:
98 - PyFlakes
99 - pycodestyle
100 - skrypt McCabe autorstwa Neda Batcheldera
101
102 %package -n python3-flake8
103 Summary:        The modular source code checker: pycodestyle, pyflakes and co
104 Summary(pl.UTF-8):      Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
105 Group:          Libraries/Python
106 Requires:       python3-modules >= 1:3.4
107
108 %description -n python3-flake8
109 The modular source code checker. It is a wrapper around these tools:
110 - PyFlakes
111 - pycodestyle
112 - Ned Batchelder's McCabe script
113
114 %description -n python3-flake8 -l pl.UTF-8
115 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
116 dla narzędzi:
117 - PyFlakes
118 - pycodestyle
119 - skrypt McCabe autorstwa Neda Batcheldera
120
121 %package -n python-flake8-apidocs
122 Summary:        API documentation for Python flake8 module
123 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona flake8
124 Group:          Documentation
125
126 %description -n python-flake8-apidocs
127 API documentation for Python flake8 module.
128
129 %description -n python-flake8-apidocs -l pl.UTF-8
130 Dokumentacja API modułu Pythona flake8.
131
132 %prep
133 %setup -q
134 %patch0 -p1
135
136 %build
137 %if %{with python2}
138 %py_build
139
140 %if %{with tests}
141 PYTHONPATH=$(pwd)/src \
142 %{__python} -m pytest -rw tests
143 %endif
144 %endif
145
146 %if %{with python3}
147 # don't require standalone mock
148 %{__sed} -i -e 's/import mock/from unittest import mock/' $(grep 'import mock' tests/ -rl)
149
150 %py3_build
151
152 %if %{with tests}
153 PYTHONPATH=$(pwd)/src \
154 %{__python3} -m pytest -rw tests
155 %endif
156 %endif
157
158 %if %{with doc}
159 cd docs/source
160 PYTHONPATH=$(pwd)/../../src \
161 sphinx-build-3 -b html . _build/html
162 %endif
163
164 %install
165 rm -rf $RPM_BUILD_ROOT
166
167 %if %{with python2}
168 %py_install
169 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-2}
170 %py_postclean
171 %endif
172
173 %if %{with python3}
174 %py3_install
175 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-3}
176 %endif
177
178 ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8
179
180 %clean
181 rm -rf $RPM_BUILD_ROOT
182
183 %files
184 %defattr(644,root,root,755)
185 %attr(755,root,root) %{_bindir}/flake8
186
187 %if %{with python2}
188 %files -n python-flake8
189 %defattr(644,root,root,755)
190 %doc CONTRIBUTORS.txt LICENSE README.rst
191 %attr(755,root,root) %{_bindir}/flake8-2
192 %{py_sitescriptdir}/flake8
193 %{py_sitescriptdir}/flake8-%{version}-py*.egg-info
194 %endif
195
196 %if %{with python3}
197 %files -n python3-flake8
198 %defattr(644,root,root,755)
199 %doc CONTRIBUTORS.txt LICENSE README.rst
200 %attr(755,root,root) %{_bindir}/flake8-3
201 %{py3_sitescriptdir}/flake8
202 %{py3_sitescriptdir}/flake8-%{version}-py*.egg-info
203 %endif
204
205 %if %{with doc}
206 %files -n python-flake8-apidocs
207 %defattr(644,root,root,755)
208 %doc docs/source/_build/html/{_modules,_static,internal,plugin-development,release-notes,user,*.html,*.js}
209 %endif
This page took 0.069196 seconds and 4 git commands to generate.