]>
Commit | Line | Data |
---|---|---|
9debd1ef JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # py.test tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: py.test plugin to check FLAKE8 requirements | |
8 | Summary(pl.UTF-8): Wtyczka py.test do sprawdzania wymagań FLAKE8 | |
9 | Name: python-pytest-flake8 | |
611136f8 | 10 | # keep 1.0.x here for python2 support |
e0c03548 | 11 | Version: 1.0.7 |
de03d1a2 | 12 | Release: 3 |
9debd1ef JB |
13 | License: BSD |
14 | Group: Libraries/Python | |
74fc926a | 15 | #Source0Download: https://pypi.org/simple/pytest-flake8/ |
9debd1ef | 16 | Source0: https://files.pythonhosted.org/packages/source/p/pytest-flake8/pytest-flake8-%{version}.tar.gz |
e0c03548 | 17 | # Source0-md5: e50df912c25866bfcb1a7266d6e266ef |
9debd1ef JB |
18 | URL: https://github.com/tholo/pytest-flake8 |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
74fc926a JB |
23 | BuildRequires: python-flake8 >= 3.5 |
24 | BuildRequires: python-pytest >= 3.5 | |
9debd1ef JB |
25 | %endif |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules >= 1:3.4 | |
29 | BuildRequires: python3-setuptools | |
30 | %if %{with tests} | |
74fc926a JB |
31 | BuildRequires: python3-flake8 >= 3.5 |
32 | BuildRequires: python3-pytest >= 3.5 | |
9debd1ef JB |
33 | %endif |
34 | %endif | |
35 | BuildRequires: rpm-pythonprov | |
36 | BuildRequires: rpmbuild(macros) >= 1.714 | |
37 | Requires: python-modules >= 1:2.7 | |
38 | BuildArch: noarch | |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %description | |
42 | py.test plugin for efficiently checking PEP8 compliance. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Wtyczka py.test do efektywnego sprawdzania zgodności z PEP8. | |
46 | ||
47 | %package -n python3-pytest-flake8 | |
48 | Summary: py.test plugin to check FLAKE8 requirements | |
49 | Summary(pl.UTF-8): Wtyczka py.test do sprawdzania wymagań FLAKE8 | |
50 | Group: Libraries/Python | |
51 | Requires: python3-modules >= 1:3.4 | |
52 | ||
53 | %description -n python3-pytest-flake8 | |
54 | py.test plugin for efficiently checking PEP8 compliance. | |
55 | ||
56 | %description -n python3-pytest-flake8 -l pl.UTF-8 | |
57 | Wtyczka py.test do efektywnego sprawdzania zgodności z PEP8. | |
58 | ||
59 | %prep | |
60 | %setup -q -n pytest-flake8-%{version} | |
9debd1ef JB |
61 | |
62 | %build | |
63 | %if %{with python2} | |
64 | %py_build | |
65 | ||
e0c03548 JB |
66 | %if %{with tests} |
67 | PYTHONPATH=$(pwd) \ | |
68 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
69 | PYTEST_PLUGINS="pytest_flake8" \ | |
70 | %{__python} -m pytest | |
71 | %endif | |
9debd1ef JB |
72 | %endif |
73 | ||
74 | %if %{with python3} | |
75 | %py3_build | |
76 | ||
e0c03548 JB |
77 | %if %{with tests} |
78 | PYTHONPATH=$(pwd) \ | |
79 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
80 | PYTEST_PLUGINS="pytest_flake8" \ | |
81 | %{__python3} -m pytest | |
82 | %endif | |
9debd1ef JB |
83 | %endif |
84 | ||
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %py_install | |
90 | ||
91 | %py_postclean | |
92 | %endif | |
93 | ||
94 | %if %{with python3} | |
95 | %py3_install | |
96 | %endif | |
97 | ||
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %if %{with python2} | |
102 | %files | |
103 | %defattr(644,root,root,755) | |
104 | %doc CHANGELOG LICENSE README.rst | |
105 | %{py_sitescriptdir}/pytest_flake8.py[co] | |
106 | %{py_sitescriptdir}/pytest_flake8-%{version}-py*.egg-info | |
107 | %endif | |
108 | ||
109 | %if %{with python3} | |
110 | %files -n python3-pytest-flake8 | |
111 | %defattr(644,root,root,755) | |
112 | %doc CHANGELOG LICENSE README.rst | |
113 | %{py3_sitescriptdir}/pytest_flake8.py | |
114 | %{py3_sitescriptdir}/__pycache__/pytest_flake8.cpython-*.py[co] | |
115 | %{py3_sitescriptdir}/pytest_flake8-%{version}-py*.egg-info | |
116 | %endif |