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