From 837ae06101e5c4d5893a58aa0b3f55489c7050de Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 22 Sep 2020 13:15:18 +0200 Subject: [PATCH] Switch to %pyproject_wheel and %pyproject_install macros --- python-flit.spec | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/python-flit.spec b/python-flit.spec index f2122d5..9d84293 100644 --- a/python-flit.spec +++ b/python-flit.spec @@ -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