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