diff --git a/macros.python b/macros.python index 0b00946..d69dd4f 100644 --- a/macros.python +++ b/macros.python @@ -44,6 +44,12 @@ %py_install_wheel() %{expand:\\\ pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps rm -rfv %{buildroot}%{_bindir}/__pycache__ + for distinfo in %{buildroot}%{python_sitelib}/*.dist-info %{buildroot}%{python_sitearch}/*.dist-info; do + if [ -f ${distinfo}/direct_url.json ]; then + rm -fv ${distinfo}/direct_url.json + sed -i '/direct_url.json/d' ${distinfo}/RECORD + fi + done } %python_provide() %{lua: diff --git a/macros.python2 b/macros.python2 index e004554..82d7428 100644 --- a/macros.python2 +++ b/macros.python2 @@ -46,4 +46,10 @@ %py2_install_wheel() %{expand:\\\ pip%{python2_version} install -I dist/%{1} --root %{buildroot} --no-deps rm -rfv %{buildroot}%{_bindir}/__pycache__ + for distinfo in %{buildroot}%{python2_sitelib}/*.dist-info %{buildroot}%{python2_sitearch}/*.dist-info; do + if [ -f ${distinfo}/direct_url.json ]; then + rm -fv ${distinfo}/direct_url.json + sed -i '/direct_url.json/d' ${distinfo}/RECORD + fi + done } diff --git a/macros.python3 b/macros.python3 index f3727b7..7af56f1 100644 --- a/macros.python3 +++ b/macros.python3 @@ -40,6 +40,12 @@ %py3_install_wheel() %{expand:\\\ pip%{python3_version} install -I dist/%{1} --root %{buildroot} --no-deps rm -rfv %{buildroot}%{_bindir}/__pycache__ + for distinfo in %{buildroot}%{python3_sitelib}/*.dist-info %{buildroot}%{python3_sitearch}/*.dist-info; do + if [ -f ${distinfo}/direct_url.json ]; then + rm -fv ${distinfo}/direct_url.json + sed -i '/direct_url.json/d' ${distinfo}/RECORD + fi + done } # This only supports Python 3.5+ and will never work with Python 2. diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 134e4e5..c975feb 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3.8 -Release: 3%{?dist} +Release: 4%{?dist} Summary: The common Python RPM macros # macros: MIT, compileall2.py: PSFv2 @@ -80,6 +80,10 @@ install -m 644 %{SOURCE5} \ %changelog +* Mon May 04 2020 Tomas Hrnciar - 3.8-4 +- Make %%py3_install_wheel macro remove direct_url.json file created by PEP 610. +- https://discuss.python.org/t/pep-610-usage-guidelines-for-linux-distributions/4012 + * Mon Apr 27 2020 Miro HronĨok - 3.8-3 - Make pythonX-rpm-macros depend on python-rpm-macros (#1827811)