No edit summary |
m (→Install section: Fix typo in %{buildroot}) |
||
Line 39: | Line 39: | ||
%if 0%{?with_python3} | %if 0%{?with_python3} | ||
pushd %{py3dir} | pushd %{py3dir} | ||
pip3 install -I dist/%{python3_wheelname} --root %{ | pip3 install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix | ||
popd | popd | ||
%endif | %endif | ||
Line 47: | Line 47: | ||
{{Anchor|Files}} | {{Anchor|Files}} | ||
== Files section == | == Files section == | ||
Revision as of 13:31, 21 October 2014
Python Wheels in fedora
Since Fedora 22 we will be using Python Wheels to install Python modules. Python wheels are a built-package format -- a ZIP archive with specially formatted file name and .whl extension.
Buildrequires
Packages should now Buildrequire python-pip and python-wheel:
BuildRequires: python-pip BuildRequires: python-wheel
Build section
Packages should now use the 'bdist_wheel' argument, instead of 'install', the simplest build section thus becomes:
%{__python2} setup.py bdist_wheel %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py bdist_wheel popd %endif
Install section
Packages should now use pip to install themselves, the simplest install section thus becomes: (mention strip-file-prefix)
%if 0%{?with_python3} pushd %{py3dir} pip3 install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix popd %endif pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix
Files section
You may need to add the following entries to the files section:
%{python2_sitelib}/%{name}-%{version}.dist-info/ %{python3_sitelib}/%{name}-%{version}.dist-info/