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