]> git.pld-linux.org Git - packages/python-wheel.git/blob - python-wheel.spec
rebuild with tests and docs
[packages/python-wheel.git] / python-wheel.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx 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 %define         module  wheel
9 Summary:        A built-package format for Python
10 Summary(pl.UTF-8):      Format zbudowanych pakietów dla Pythona
11 Name:           python-%{module}
12 Version:        0.37.1
13 Release:        3
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.python.org/simple/wheel/
17 Source0:        https://pypi.python.org/packages/source/w/wheel/%{module}-%{version}.tar.gz
18 # Source0-md5:  f490f1399e5903706cb1d4fbed9ecb28
19 URL:            https://bitbucket.org/pypa/wheel
20 %if %{with python2}
21 BuildRequires:  python-devel >= 1:2.7
22 BuildRequires:  python-setuptools >= 1:40.9.0
23 %if %{with tests}
24 BuildRequires:  python-keyring
25 BuildRequires:  python-pytest >= 3.0.0
26 BuildRequires:  python-pytest-cov
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-devel >= 1:3.5
31 BuildRequires:  python3-setuptools >= 1:40.9.0
32 %if %{with tests}
33 BuildRequires:  python3-keyring
34 BuildRequires:  python3-pytest >= 3.0.0
35 BuildRequires:  python3-pytest-cov
36 %endif
37 %endif
38 %if %{with doc}
39 BuildRequires:  sphinx-pdg
40 %endif
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.714
43 BuildArch:      noarch
44 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46 %description
47 A built-package format for Python.
48
49 A wheel is a ZIP-format archive with a specially formatted filename
50 and the .whl extension. It is designed to contain all the files for a
51 PEP 376 compatible install in a way that is very close to the on-disk
52 format.
53
54 %description -l pl.UTF-8
55 Format zbudowanych pakietów dla Pythona.
56
57 "wheel" to archiwum w formacie ZIP ze specjalnie sformatowaną nazwą
58 pliku oraz rozszerzeniem ".whl". Jest zaprojektowane, aby zawierało
59 wszystkie pliki instalacji zgodnej z PEP 376 w sposób bardzo zbliżony
60 do formatu na dysku.
61
62 %package -n python3-%{module}
63 Summary:        A built-package format for Python
64 Summary(pl.UTF-8):      Format zbudowanych pakietów dla Pythona
65 Group:          Libraries/Python
66 # /usr/bin/wheel migration
67 Conflicts:      python-wheel < 0.37.1
68
69 %description -n python3-%{module}
70 A built-package format for Python.
71
72 A wheel is a ZIP-format archive with a specially formatted filename
73 and the .whl extension. It is designed to contain all the files for a
74 PEP 376 compatible install in a way that is very close to the on-disk
75 format.
76
77 %description -n python3-%{module} -l pl.UTF-8
78 Format zbudowanych pakietów dla Pythona.
79
80 "wheel" to archiwum w formacie ZIP ze specjalnie sformatowaną nazwą
81 pliku oraz rozszerzeniem ".whl". Jest zaprojektowane, aby zawierało
82 wszystkie pliki instalacji zgodnej z PEP 376 w sposób bardzo zbliżony
83 do formatu na dysku.
84
85 %package apidocs
86 Summary:        API documentation for Python wheel module
87 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona wheel
88 Group:          Documentation
89
90 %description apidocs
91 API documentation for Python wheel module.
92
93 %description apidocs -l pl.UTF-8
94 Dokumentacja API modułu Pythona wheel.
95
96 %prep
97 %setup -q -n %{module}-%{version}
98
99 %build
100 %if %{with python2}
101 %py_build
102
103 %if %{with tests}
104 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
105 PYTEST_PLUGINS="pytest_cov.plugin" \
106 PYTHONPATH=$(pwd)/src \
107 %{__python} -m pytest tests -k 'not test_macosx_libfile'
108 %endif
109 %endif
110
111 %if %{with python3}
112 %py3_build
113
114 %if %{with tests}
115 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
116 PYTEST_PLUGINS="pytest_cov.plugin" \
117 PYTHONPATH=$(pwd)/src \
118 %{__python3} -m pytest tests -k 'not test_macosx_libfile'
119 %endif
120 %endif
121
122 %if %{with doc}
123 %{__make} -C docs html
124 %endif
125
126 %install
127 rm -rf $RPM_BUILD_ROOT
128
129 %if %{with python2}
130 %py_install
131
132 %{__mv} $RPM_BUILD_ROOT%{_bindir}/wheel{,-2}
133
134 %py_postclean
135 %endif
136
137 %if %{with python3}
138 %py3_install
139
140 %{__mv} $RPM_BUILD_ROOT%{_bindir}/wheel{,-3}
141 ln -sf wheel-3 $RPM_BUILD_ROOT%{_bindir}/wheel
142 %endif
143
144 %clean
145 rm -rf $RPM_BUILD_ROOT
146
147 %if %{with python2}
148 %files
149 %defattr(644,root,root,755)
150 %doc LICENSE.txt README.rst
151 %attr(755,root,root) %{_bindir}/wheel-2
152 %{py_sitescriptdir}/wheel
153 %{py_sitescriptdir}/wheel-%{version}-py*.egg-info
154 %endif
155
156 %if %{with python3}
157 %files -n python3-%{module}
158 %defattr(644,root,root,755)
159 %doc LICENSE.txt README.rst
160 %attr(755,root,root) %{_bindir}/wheel
161 %attr(755,root,root) %{_bindir}/wheel-3
162 %{py3_sitescriptdir}/wheel
163 %{py3_sitescriptdir}/wheel-%{version}-py*.egg-info
164 %endif
165
166 %if %{with doc}
167 %files apidocs
168 %defattr(644,root,root,755)
169 %doc docs/_build/html/{_static,reference,*.html,*.js}
170 %endif
This page took 0.122081 seconds and 3 git commands to generate.