2019-11-13 11:39:36 +00:00
|
|
|
%_pyproject_wheeldir ./pyproject-macros-wheeldir
|
|
|
|
|
2019-07-02 10:41:04 +00:00
|
|
|
%pyproject_wheel() %{expand:\\\
|
2019-07-02 14:53:05 +00:00
|
|
|
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \\\
|
2019-11-13 11:39:36 +00:00
|
|
|
%{__python3} -m pip wheel --wheel-dir %{_pyproject_wheeldir} --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --progress-bar off --verbose .
|
2019-07-02 10:41:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
%pyproject_install() %{expand:\\\
|
2019-11-13 11:39:36 +00:00
|
|
|
%{__python3} -m pip install --root %{buildroot} --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location %{_pyproject_wheeldir}/*.whl
|
2019-07-02 14:53:05 +00:00
|
|
|
if [ -d %{buildroot}%{_bindir} ]; then
|
2020-02-05 13:33:50 +00:00
|
|
|
pathfix.py -pni "%{__python3}" -k%{?py3_shbang_opts: -a%{py3_shbang_opts_nodash}} %{buildroot}%{_bindir}/*
|
2019-11-13 11:41:31 +00:00
|
|
|
rm -rfv %{buildroot}%{_bindir}/__pycache__
|
2019-07-02 10:41:04 +00:00
|
|
|
fi
|
2019-07-02 14:53:05 +00:00
|
|
|
if [ -d %{buildroot}%{python3_sitelib} ]; then
|
|
|
|
sed -i 's/pip/rpm/' %{buildroot}%{python3_sitelib}/*.dist-info/INSTALLER
|
2019-07-02 11:57:24 +00:00
|
|
|
fi
|
2019-07-02 14:53:05 +00:00
|
|
|
if [ -d %{buildroot}%{python3_sitearch} ]; then
|
|
|
|
sed -i 's/pip/rpm/' %{buildroot}%{python3_sitearch}/*.dist-info/INSTALLER
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-07-26 15:50:36 +00:00
|
|
|
%default_toxenv py%{python3_version_nodots}
|
|
|
|
%toxenv %{default_toxenv}
|
2019-07-26 14:15:59 +00:00
|
|
|
|
2019-08-13 12:42:21 +00:00
|
|
|
%pyproject_buildrequires(rxte:) %{expand:\\\
|
|
|
|
%{-e:%{expand:%global toxenv %{-e*}}}
|
2019-07-02 14:53:05 +00:00
|
|
|
echo 'python3-devel'
|
|
|
|
echo 'python3dist(packaging)'
|
|
|
|
echo 'python3dist(pytoml)'
|
2019-07-17 16:16:16 +00:00
|
|
|
# setuptools assumes no pre-existing dist-info
|
2019-10-08 11:01:08 +00:00
|
|
|
rm -rfv *.dist-info/ >&2
|
2019-07-02 14:53:05 +00:00
|
|
|
if [ -f %{__python3} ]; then
|
2019-08-21 16:01:31 +00:00
|
|
|
RPM_TOXENV="%{toxenv}" %{__python3} -I %{_rpmconfigdir}/redhat/pyproject_buildrequires.py %{?**}
|
2019-07-02 10:41:04 +00:00
|
|
|
fi
|
|
|
|
}
|
2019-07-26 15:50:36 +00:00
|
|
|
|
|
|
|
%tox(e:) %{expand:\\\
|
|
|
|
TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \\
|
|
|
|
PATH="%{buildroot}%{_bindir}:$PATH" \\
|
|
|
|
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \\
|
|
|
|
tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*}
|
|
|
|
}
|