]>
Commit | Line | Data |
---|---|---|
a24e9a34 ER |
1 | # |
2 | # Conditional build: | |
37b9d23d JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
a24e9a34 ER |
5 | %bcond_without tests # do not perform "make test" |
6 | ||
d7cb1ebf JB |
7 | Summary: The modular source code checker: pycodestyle, pyflakes and co |
8 | Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp. | |
abcf879e | 9 | Name: flake8 |
9bc90c26 | 10 | Version: 3.3.0 |
975a3e6b | 11 | Release: 3 |
abcf879e AM |
12 | License: MIT |
13 | Group: Development/Tools | |
37b9d23d | 14 | #Source0Download: https://pypi.python.org/simple/flake8/ |
d7cb1ebf | 15 | Source0: https://files.pythonhosted.org/packages/source/f/flake8/%{name}-%{version}.tar.gz |
9bc90c26 | 16 | # Source0-md5: 3df622aac9bad27c04f34164609bbed8 |
d7cb1ebf JB |
17 | Patch0: %{name}-mock.patch |
18 | URL: https://gitlab.com/pycqa/flake8 | |
37b9d23d | 19 | BuildRequires: rpmbuild(macros) >= 1.714 |
abcf879e | 20 | BuildRequires: rpm-pythonprov |
37b9d23d | 21 | %if %{with python2} |
d7cb1ebf | 22 | BuildRequires: python-modules >= 1:2.7 |
37b9d23d JB |
23 | BuildRequires: python-setuptools |
24 | %if %{with tests} | |
9bc90c26 | 25 | BuildRequires: python-configparser |
d7cb1ebf JB |
26 | BuildRequires: python-enum34 |
27 | BuildRequires: python-mccabe >= 0.6.0 | |
28 | BuildRequires: python-mccabe < 0.7.0 | |
972dfbb9 | 29 | BuildRequires: python-mock >= 2.0.0 |
53123676 | 30 | BuildRequires: python-pycodestyle >= 2.0.0 |
d7cb1ebf JB |
31 | BuildRequires: python-pycodestyle < 2.4.0 |
32 | BuildRequires: python-pyflakes >= 1.5.0 | |
33 | BuildRequires: python-pyflakes < 1.6.0 | |
34 | BuildRequires: python-pytest | |
35 | BuildRequires: python-pytest-runner | |
37b9d23d JB |
36 | %endif |
37 | %endif | |
38 | %if %{with python3} | |
d7cb1ebf | 39 | BuildRequires: python3-modules >= 1:3.4 |
37b9d23d | 40 | BuildRequires: python3-setuptools |
a24e9a34 | 41 | %if %{with tests} |
d7cb1ebf JB |
42 | BuildRequires: python3-mccabe >= 0.6.0 |
43 | BuildRequires: python3-mccabe < 0.7.0 | |
53123676 | 44 | BuildRequires: python3-pycodestyle >= 2.0.0 |
d7cb1ebf JB |
45 | BuildRequires: python3-pycodestyle < 2.4.0 |
46 | BuildRequires: python3-pyflakes >= 1.5.0 | |
47 | BuildRequires: python3-pyflakes < 1.6.0 | |
48 | BuildRequires: python3-pytest | |
49 | BuildRequires: python3-pytest-runner | |
50 | BuildRequires: sed >= 4.0 | |
a24e9a34 | 51 | %endif |
37b9d23d JB |
52 | %endif |
53 | %if %{with python3} | |
54 | Requires: python3-flake8 = %{version}-%{release} | |
55 | %else | |
56 | Requires: python-flake8 = %{version}-%{release} | |
57 | %endif | |
abcf879e AM |
58 | BuildArch: noarch |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
60 | ||
61 | %description | |
62 | The modular source code checker. It is a wrapper around these tools: | |
63 | - PyFlakes | |
d7cb1ebf | 64 | - pycodestyle |
abcf879e AM |
65 | - Ned Batchelder's McCabe script |
66 | ||
37b9d23d JB |
67 | %description -l pl.UTF-8 |
68 | Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie | |
69 | dla narzędzi: | |
70 | - PyFlakes | |
d7cb1ebf | 71 | - pycodestyle |
37b9d23d JB |
72 | - skrypt McCabe autorstwa Neda Batcheldera |
73 | ||
74 | %package -n python-flake8 | |
d7cb1ebf JB |
75 | Summary: The modular source code checker: pycodestyle, pyflakes and co |
76 | Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp. | |
37b9d23d | 77 | Group: Libraries/Python |
d7cb1ebf | 78 | Requires: python-modules >= 1:2.7 |
37b9d23d JB |
79 | |
80 | %description -n python-flake8 | |
81 | The modular source code checker. It is a wrapper around these tools: | |
82 | - PyFlakes | |
d7cb1ebf | 83 | - pycodestyle |
37b9d23d JB |
84 | - Ned Batchelder's McCabe script |
85 | ||
86 | %description -n python-flake8 -l pl.UTF-8 | |
87 | Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie | |
88 | dla narzędzi: | |
89 | - PyFlakes | |
d7cb1ebf | 90 | - pycodestyle |
37b9d23d JB |
91 | - skrypt McCabe autorstwa Neda Batcheldera |
92 | ||
93 | %package -n python3-flake8 | |
d7cb1ebf JB |
94 | Summary: The modular source code checker: pycodestyle, pyflakes and co |
95 | Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp. | |
37b9d23d | 96 | Group: Libraries/Python |
d7cb1ebf | 97 | Requires: python3-modules >= 1:3.4 |
37b9d23d JB |
98 | |
99 | %description -n python3-flake8 | |
100 | The modular source code checker. It is a wrapper around these tools: | |
101 | - PyFlakes | |
d7cb1ebf | 102 | - pycodestyle |
37b9d23d JB |
103 | - Ned Batchelder's McCabe script |
104 | ||
105 | %description -n python3-flake8 -l pl.UTF-8 | |
106 | Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie | |
107 | dla narzędzi: | |
108 | - PyFlakes | |
d7cb1ebf | 109 | - pycodestyle |
37b9d23d JB |
110 | - skrypt McCabe autorstwa Neda Batcheldera |
111 | ||
abcf879e AM |
112 | %prep |
113 | %setup -q | |
d7cb1ebf | 114 | %patch0 -p1 |
abcf879e AM |
115 | |
116 | %build | |
37b9d23d JB |
117 | %if %{with python2} |
118 | %py_build %{?with_tests:test} | |
119 | %endif | |
120 | ||
121 | %if %{with python3} | |
d7cb1ebf JB |
122 | # don't require standalone mock |
123 | %{__sed} -i -e 's/import mock/from unittest import mock/' $(grep 'import mock' tests/ -rl) | |
124 | ||
33643bb9 | 125 | %py3_build %{?with_tests:test} |
37b9d23d | 126 | %endif |
abcf879e AM |
127 | |
128 | %install | |
129 | rm -rf $RPM_BUILD_ROOT | |
37b9d23d JB |
130 | |
131 | %if %{with python2} | |
132 | %py_install | |
d7cb1ebf | 133 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-2} |
37b9d23d JB |
134 | %py_postclean |
135 | %endif | |
136 | ||
137 | %if %{with python3} | |
33643bb9 | 138 | %py3_install |
d7cb1ebf | 139 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-3} |
37b9d23d | 140 | %endif |
abcf879e | 141 | |
8b0b6706 ER |
142 | ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8 |
143 | ||
abcf879e AM |
144 | %clean |
145 | rm -rf $RPM_BUILD_ROOT | |
146 | ||
147 | %files | |
148 | %defattr(644,root,root,755) | |
9bc90c26 | 149 | %doc CONTRIBUTORS.txt LICENSE README.rst |
abcf879e | 150 | %attr(755,root,root) %{_bindir}/flake8 |
37b9d23d JB |
151 | |
152 | %if %{with python2} | |
153 | %files -n python-flake8 | |
154 | %defattr(644,root,root,755) | |
155 | %attr(755,root,root) %{_bindir}/flake8-2 | |
156 | %{py_sitescriptdir}/flake8 | |
157 | %{py_sitescriptdir}/flake8-%{version}-py*.egg-info | |
158 | %endif | |
159 | ||
160 | %if %{with python3} | |
161 | %files -n python3-flake8 | |
162 | %defattr(644,root,root,755) | |
163 | %attr(755,root,root) %{_bindir}/flake8-3 | |
164 | %{py3_sitescriptdir}/flake8 | |
165 | %{py3_sitescriptdir}/flake8-%{version}-py*.egg-info | |
166 | %endif |