]> git.pld-linux.org Git - packages/flake8.git/blob - flake8.spec
Release 3 (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   # do not perform "make test"
6
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.
9 Name:           flake8
10 Version:        3.3.0
11 Release:        2
12 License:        MIT
13 Group:          Development/Tools
14 #Source0Download: https://pypi.python.org/simple/flake8/
15 Source0:        https://files.pythonhosted.org/packages/source/f/flake8/%{name}-%{version}.tar.gz
16 # Source0-md5:  3df622aac9bad27c04f34164609bbed8
17 Patch0:         %{name}-mock.patch
18 URL:            https://gitlab.com/pycqa/flake8
19 BuildRequires:  rpmbuild(macros) >= 1.714
20 BuildRequires:  rpm-pythonprov
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  python-configparser
26 BuildRequires:  python-enum34
27 BuildRequires:  python-mccabe >= 0.6.0
28 BuildRequires:  python-mccabe < 0.7.0
29 BuildRequires:  python-mock >= 2.0.0
30 BuildRequires:  python-pycodestyle >= 2.0.0
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
36 %endif
37 %endif
38 %if %{with python3}
39 BuildRequires:  python3-modules >= 1:3.4
40 BuildRequires:  python3-setuptools
41 %if %{with tests}
42 BuildRequires:  python3-mccabe >= 0.6.0
43 BuildRequires:  python3-mccabe < 0.7.0
44 BuildRequires:  python3-pycodestyle >= 2.0.0
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
51 %endif
52 %endif
53 %if %{with python3}
54 Requires:       python3-flake8 = %{version}-%{release}
55 %else
56 Requires:       python-flake8 = %{version}-%{release}
57 %endif
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
64 - pycodestyle
65 - Ned Batchelder's McCabe script
66
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
71 - pycodestyle
72 - skrypt McCabe autorstwa Neda Batcheldera
73
74 %package -n python-flake8
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.
77 Group:          Libraries/Python
78 Requires:       python-modules >= 1:2.7
79
80 %description -n python-flake8
81 The modular source code checker. It is a wrapper around these tools:
82 - PyFlakes
83 - pycodestyle
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
90 - pycodestyle
91 - skrypt McCabe autorstwa Neda Batcheldera
92
93 %package -n python3-flake8
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.
96 Group:          Libraries/Python
97 Requires:       python3-modules >= 1:3.4
98
99 %description -n python3-flake8
100 The modular source code checker. It is a wrapper around these tools:
101 - PyFlakes
102 - pycodestyle
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
109 - pycodestyle
110 - skrypt McCabe autorstwa Neda Batcheldera
111
112 %prep
113 %setup -q
114 %patch0 -p1
115
116 %build
117 %if %{with python2}
118 %py_build %{?with_tests:test}
119 %endif
120
121 %if %{with python3}
122 # don't require standalone mock
123 %{__sed} -i -e 's/import mock/from unittest import mock/' $(grep 'import mock' tests/ -rl)
124
125 %py3_build %{?with_tests:test}
126 %endif
127
128 %install
129 rm -rf $RPM_BUILD_ROOT
130
131 %if %{with python2}
132 %py_install
133 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-2}
134 %py_postclean
135 %endif
136
137 %if %{with python3}
138 %py3_install
139 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-3}
140 %endif
141
142 ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8
143
144 %clean
145 rm -rf $RPM_BUILD_ROOT
146
147 %files
148 %defattr(644,root,root,755)
149 %doc CONTRIBUTORS.txt LICENSE README.rst
150 %attr(755,root,root) %{_bindir}/flake8
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
This page took 0.091909 seconds and 3 git commands to generate.