]> git.pld-linux.org Git - packages/python-pep8.git/blob - python-pep8.spec
74822594a857b6451ba4fd41b27069230e421180
[packages/python-pep8.git] / python-pep8.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # test target
4 %bcond_without  doc     # Build API documentation
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  pep8
9 Summary:        Python style guide checker
10 Summary(pl.UTF-8):      Sprawdzanie zgodności z poradnikiem stylu kodowania w Pythonie
11 Name:           python-%{module}
12 Version:        1.7.1
13 Release:        4
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/pep8/
17 Source0:        https://files.pythonhosted.org/packages/source/p/pep8/%{module}-%{version}.tar.gz
18 # Source0-md5:  603821d06db945c71d811b5a8d78423c
19 Patch0:         %{name}-nestedset.patch
20 Patch1:         %{name}-tokenize.patch
21 URL:            https://pypi.org/project/pep8/
22 BuildRequires:  rpm-pythonprov
23 BuildRequires:  rpmbuild(macros) >= 1.714
24 %if %{with python2}
25 BuildRequires:  python-setuptools
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-setuptools
29 %endif
30 %{?with_doc:BuildRequires:      sphinx-pdg}
31 Requires:       python-modules
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %description
36 pep8 is a tool to check your Python code against some of the style
37 conventions in PEP 8.
38
39 Note: it's deprecated in favour on pycodestyle.
40
41 %description -l pl.UTF-8
42 pep8 to narzędzie do sprawdzania kodu w Pythonie względem niektórych
43 konwencji stylistycznych opisanych w PEP 8.
44
45 Uwaga: to narzędzie jest przestarzałe, nowszą wersją jest pycodestyle.
46
47 %package -n python3-%{module}
48 Summary:        Python style guide checker
49 Summary(pl.UTF-8):      Sprawdzanie zgodności z poradnikiem stylu kodowania w Pythonie
50 Group:          Libraries/Python
51 Requires:       python3-modules
52
53 %description -n python3-%{module}
54 pep8 is a tool to check your Python code against some of the style
55 conventions in PEP 8.
56
57 Note: it's deprecated in favour on pycodestyle.
58
59 %description -n python3-%{module} -l pl.UTF-8
60 pep8 to narzędzie do sprawdzania kodu w Pythonie względem niektórych
61 konwencji stylistycznych opisanych w PEP 8.
62
63 Uwaga: to narzędzie jest przestarzałe, nowszą wersją jest pycodestyle.
64
65 %package apidocs
66 Summary:        API documentation for pep8 module
67 Summary(pl.UTF-8):      Dokumentacja API modułu pep8
68 Group:          Documentation
69
70 %description apidocs
71 API documentation for pep8 module.
72
73 %description apidocs -l pl.UTF-8
74 Dokumentacja API modułu pep8.
75
76 %prep
77 %setup -q -n %{module}-%{version}
78 %patch0 -p1
79 %patch1 -p1
80
81 %build
82 # pep8 issues deprecance warning, which causes some tests to fail
83 export PYTHONWARNINGS=ignore
84
85 %if %{with python2}
86 %py_build
87
88 %if %{with tests}
89 %{__python} -m testsuite.test_all
90 %endif
91 %endif
92
93 %if %{with python3}
94 %py3_build
95
96 %if %{with tests}
97 %{__python3} -m testsuite.test_all
98 %endif
99 %endif
100
101 %if %{with doc}
102 %{__make} -C docs -j1 html
103 %endif
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107 %if %{with python2}
108 %py_install
109
110 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pep8{,-2}
111 %py_postclean
112 %endif
113
114 %if %{with python3}
115 %py3_install
116 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pep8{,-3}
117 %endif
118
119 %if %{with python2}
120 ln -s pep8-2 $RPM_BUILD_ROOT%{_bindir}/pep8
121 %endif
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %if %{with python2}
127 %files
128 %defattr(644,root,root,755)
129 %doc CHANGES.txt README.rst
130 %attr(755,root,root) %{_bindir}/pep8
131 %attr(755,root,root) %{_bindir}/pep8-2
132 %{py_sitescriptdir}/pep8.py[co]
133 %if "%{py_ver}" > "2.4"
134 %{py_sitescriptdir}/pep8-%{version}-py*.egg-info
135 %endif
136 %endif
137
138 %if %{with python3}
139 %files -n python3-%{module}
140 %defattr(644,root,root,755)
141 %doc CHANGES.txt README.rst
142 %attr(755,root,root) %{_bindir}/pep8-3
143 %{py3_sitescriptdir}/pep8.py
144 %{py3_sitescriptdir}/__pycache__/pep8.cpython-*.py[co]
145 %{py3_sitescriptdir}/pep8-%{version}-py*.egg-info
146 %endif
147
148 %if %{with doc}
149 %files apidocs
150 %defattr(644,root,root,755)
151 %doc docs/_build/html/{_modules,_static,*.html,*.js}
152 %endif
This page took 0.058054 seconds and 2 git commands to generate.