]>
Commit | Line | Data |
---|---|---|
ba95afaf JB |
1 | # |
2 | # Conditional build: | |
ba95afaf | 3 | %bcond_without doc # API documentation |
4865d893 | 4 | %bcond_without tests # unit tests |
ba95afaf JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Python style guide checker | |
9 | Summary(pl.UTF-8): Sprawdzanie zgodności z poradnikiem stylu kodowania w Pythonie | |
10 | Name: python-pycodestyle | |
4865d893 | 11 | # NOTE: before upgrading to >=2.6.0 check for flake8 release supporting new pycodestyle |
7fd6ab65 | 12 | Version: 2.5.0 |
4865d893 | 13 | Release: 1 |
ba95afaf JB |
14 | License: MIT |
15 | Group: Libraries/Python | |
4865d893 | 16 | #Source0Download: https://pypi.org/simple/pycodestyle/ |
ba95afaf | 17 | Source0: https://files.pythonhosted.org/packages/source/p/pycodestyle/pycodestyle-%{version}.tar.gz |
7fd6ab65 | 18 | # Source0-md5: 40e7a76f364a18f531aaba11a4476e21 |
ba95afaf JB |
19 | URL: https://pycodestyle.readthedocs.io/ |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
7fd6ab65 | 23 | BuildRequires: python-modules >= 1:2.7 |
ba95afaf JB |
24 | BuildRequires: python-setuptools |
25 | %endif | |
26 | %if %{with python3} | |
7fd6ab65 | 27 | BuildRequires: python3-modules >= 1:3.4 |
ba95afaf JB |
28 | BuildRequires: python3-setuptools |
29 | %endif | |
30 | %{?with_doc:BuildRequires: sphinx-pdg} | |
7fd6ab65 | 31 | Requires: python-modules >= 1:2.7 |
ba95afaf JB |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | pycodestyle is a tool to check your Python code against some of the | |
37 | style conventions in PEP 8. This module was formerly called pep8. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | pycodestyle to narzędzie do sprawdzania kodu w Pythonie względem | |
41 | niektórych konwencji stylistycznych opisanych w PEP 8. Ten moduł | |
42 | wcześniej nazywał się pep8. | |
43 | ||
44 | %package -n python3-pycodestyle | |
45 | Summary: Python style guide checker | |
46 | Summary(pl.UTF-8): Sprawdzanie zgodności z poradnikiem stylu kodowania w Pythonie | |
47 | Group: Libraries/Python | |
7fd6ab65 | 48 | Requires: python3-modules >= 1:3.4 |
ba95afaf JB |
49 | |
50 | %description -n python3-pycodestyle | |
51 | pycodestyle is a tool to check your Python code against some of the | |
52 | style conventions in PEP 8. This module was formerly called pep8. | |
53 | ||
54 | %description -n python3-pycodestyle -l pl.UTF-8 | |
55 | pycodestyle to narzędzie do sprawdzania kodu w Pythonie względem | |
56 | niektórych konwencji stylistycznych opisanych w PEP 8. Ten moduł | |
57 | wcześniej nazywał się pep8. | |
58 | ||
59 | %package apidocs | |
60 | Summary: API documentation for pycodestyle module | |
61 | Summary(pl.UTF-8): Dokumentacja API modułu pycodestyle | |
62 | Group: Documentation | |
63 | ||
64 | %description apidocs | |
65 | API documentation for pycodestyle module. | |
66 | ||
67 | %description apidocs -l pl.UTF-8 | |
68 | Dokumentacja API modułu pycodestyle. | |
69 | ||
70 | %prep | |
71 | %setup -q -n pycodestyle-%{version} | |
72 | ||
73 | %build | |
74 | %if %{with python2} | |
75 | %py_build %{?with_tests:test} | |
76 | %endif | |
77 | ||
78 | %if %{with python3} | |
79 | %py3_build %{?with_tests:test} | |
80 | %endif | |
81 | ||
82 | %if %{with doc} | |
83 | %{__make} -C docs html | |
84 | %endif | |
85 | ||
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | %if %{with python2} | |
89 | %py_install | |
90 | ||
91 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pycodestyle{,-2} | |
92 | %py_postclean | |
93 | %endif | |
94 | ||
95 | %if %{with python3} | |
96 | %py3_install | |
97 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pycodestyle{,-3} | |
98 | %endif | |
99 | ||
100 | %if %{with python2} | |
101 | ln -s pycodestyle-2 $RPM_BUILD_ROOT%{_bindir}/pycodestyle | |
102 | %endif | |
103 | ||
104 | %clean | |
105 | rm -rf $RPM_BUILD_ROOT | |
106 | ||
107 | %if %{with python2} | |
108 | %files | |
109 | %defattr(644,root,root,755) | |
4865d893 | 110 | %doc CHANGES.txt LICENSE README.rst |
ba95afaf JB |
111 | %attr(755,root,root) %{_bindir}/pycodestyle |
112 | %attr(755,root,root) %{_bindir}/pycodestyle-2 | |
113 | %{py_sitescriptdir}/pycodestyle.py[co] | |
ba95afaf JB |
114 | %{py_sitescriptdir}/pycodestyle-%{version}-py*.egg-info |
115 | %endif | |
ba95afaf JB |
116 | |
117 | %if %{with python3} | |
118 | %files -n python3-pycodestyle | |
119 | %defattr(644,root,root,755) | |
4865d893 | 120 | %doc CHANGES.txt LICENSE README.rst |
ba95afaf JB |
121 | %attr(755,root,root) %{_bindir}/pycodestyle-3 |
122 | %{py3_sitescriptdir}/pycodestyle.py | |
123 | %{py3_sitescriptdir}/__pycache__/pycodestyle.cpython-*.py[co] | |
124 | %{py3_sitescriptdir}/pycodestyle-%{version}-py*.egg-info | |
125 | %endif | |
126 | ||
127 | %if %{with doc} | |
128 | %files apidocs | |
129 | %defattr(644,root,root,755) | |
130 | %doc docs/_build/html/{_modules,_static,*.html,*.js} | |
131 | %endif |