Switch to %pyproject_wheel and %pyproject_install macros

epel9
Lumir Balhar 4 years ago
parent 8f4cf57888
commit 837ae06101

@ -20,6 +20,7 @@ Source1: https://pypi.org/pypi?%3Aaction=list_classifiers#/classifiers.lst
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
BuildRequires: python3-pip
BuildRequires: python3-requests
BuildRequires: python3-docutils
@ -86,22 +87,17 @@ at flit_core.buildapi.
export FLIT_NO_NETWORK=1
# first, build flit_core with self
# TODO do it in a less hacky way, this is reconstructed from pyoroject.toml
cd flit_core
PYTHONPATH=$PWD %{python3} -c 'from flit_core.build_thyself import build_wheel; build_wheel(".")'
# %%py3_install_wheel unfortunately hardcodes installing from dist/
mkdir ../dist
mv flit_core-%{version}-py2.py3-none-any.whl ../dist
%pyproject_wheel
# Move %%{_pyproject_wheeldir}/flit_core wheel to the main dir
mv %{_pyproject_wheeldir} ..
cd -
PYTHONPATH=$PWD:$PWD/flit_core %{python3} -m flit build --format wheel
# build of the main flit (needs flit_core)
PYTHONPATH=$PWD:$PWD/flit_core %pyproject_wheel
%install
%py3_install_wheel flit_core-%{version}-py2.py3-none-any.whl
%py3_install_wheel flit-%{version}-py3-none-any.whl
%pyproject_install
%if %{with tests}
%check

Loading…
Cancel
Save