]> git.pld-linux.org Git - packages/python-pycodestyle.git/blob - python-pycodestyle.spec
065a058317c0a2a2352cdff7cc11429552f1091e
[packages/python-pycodestyle.git] / python-pycodestyle.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # API documentation
4 %bcond_without  tests   # unit tests
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
11 # NOTE: before upgrading to >=2.6.0 check for flake8 release supporting new pycodestyle
12 Version:        2.5.0
13 Release:        5
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/pycodestyle/
17 Source0:        https://files.pythonhosted.org/packages/source/p/pycodestyle/pycodestyle-%{version}.tar.gz
18 # Source0-md5:  40e7a76f364a18f531aaba11a4476e21
19 URL:            https://pycodestyle.readthedocs.io/
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.7
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-modules >= 1:3.4
28 BuildRequires:  python3-setuptools
29 %endif
30 %{?with_doc:BuildRequires:      sphinx-pdg}
31 Requires:       python-modules >= 1:2.7
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
48 Requires:       python3-modules >= 1:3.4
49 # default binary moved
50 Conflicts:      python-pycodestyle < 2.5.0-4
51
52 %description -n python3-pycodestyle
53 pycodestyle is a tool to check your Python code against some of the
54 style conventions in PEP 8. This module was formerly called pep8.
55
56 %description -n python3-pycodestyle -l pl.UTF-8
57 pycodestyle to narzędzie do sprawdzania kodu w Pythonie względem
58 niektórych konwencji stylistycznych opisanych w PEP 8. Ten moduł
59 wcześniej nazywał się pep8.
60
61 %package apidocs
62 Summary:        API documentation for pycodestyle module
63 Summary(pl.UTF-8):      Dokumentacja API modułu pycodestyle
64 Group:          Documentation
65
66 %description apidocs
67 API documentation for pycodestyle module.
68
69 %description apidocs -l pl.UTF-8
70 Dokumentacja API modułu pycodestyle.
71
72 %prep
73 %setup -q -n pycodestyle-%{version}
74
75 %build
76 %if %{with python2}
77 %py_build
78
79 %if %{with tests}
80 %{__python} -m testsuite.test_all
81 %endif
82 %endif
83
84 %if %{with python3}
85 %py3_build
86
87 %if %{with tests}
88 %{__python} -m testsuite.test_all
89 %endif
90 %endif
91
92 %if %{with doc}
93 %{__make} -C docs html
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98
99 %if %{with python2}
100 %py_install
101
102 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pycodestyle{,-2}
103
104 %py_postclean
105 %endif
106
107 %if %{with python3}
108 %py3_install
109
110 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pycodestyle{,-3}
111 ln -sf pycodestyle-3 $RPM_BUILD_ROOT%{_bindir}/pycodestyle
112 %endif
113
114 %clean
115 rm -rf $RPM_BUILD_ROOT
116
117 %if %{with python2}
118 %files
119 %defattr(644,root,root,755)
120 %doc CHANGES.txt LICENSE README.rst
121 %attr(755,root,root) %{_bindir}/pycodestyle-2
122 %{py_sitescriptdir}/pycodestyle.py[co]
123 %{py_sitescriptdir}/pycodestyle-%{version}-py*.egg-info
124 %endif
125
126 %if %{with python3}
127 %files -n python3-pycodestyle
128 %defattr(644,root,root,755)
129 %doc CHANGES.txt LICENSE README.rst
130 %attr(755,root,root) %{_bindir}/pycodestyle
131 %attr(755,root,root) %{_bindir}/pycodestyle-3
132 %{py3_sitescriptdir}/pycodestyle.py
133 %{py3_sitescriptdir}/__pycache__/pycodestyle.cpython-*.py[co]
134 %{py3_sitescriptdir}/pycodestyle-%{version}-py*.egg-info
135 %endif
136
137 %if %{with doc}
138 %files apidocs
139 %defattr(644,root,root,755)
140 %doc docs/_build/html/{_modules,_static,*.html,*.js}
141 %endif
This page took 0.092257 seconds and 2 git commands to generate.