diff --git a/macros.pyproject b/macros.pyproject index 6e05c27..39c0268 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -21,8 +21,9 @@ CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \\\ %pyproject_install() %{expand:\\\ +specifier=$(ls %{_pyproject_wheeldir}/*.whl | xargs basename --multiple | sed -E 's/([^-]+)-([^-]+)-.+\\\.whl/\\\1==\\\2/') export TMPDIR="${PWD}/%{_pyproject_builddir}" -%{__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 +%{__python3} -m pip install --root %{buildroot} --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links %{_pyproject_wheeldir} $specifier if [ -d %{buildroot}%{_bindir} ]; then pathfix.py -pni "%{__python3}" -k%{?py3_shbang_opts: -a%{py3_shbang_opts_nodash}} %{buildroot}%{_bindir}/* rm -rfv %{buildroot}%{_bindir}/__pycache__ diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index a09556e..2043e5d 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -6,7 +6,7 @@ License: MIT # Keep the version at zero and increment only release Version: 0 -Release: 14%{?dist} +Release: 15%{?dist} # Macro files Source001: macros.pyproject @@ -100,6 +100,9 @@ install -m 644 pyproject_save_files.py %{buildroot}%{_rpmconfigdir}/redhat/ %license LICENSE %changelog +* Thu May 07 2020 Tomas Hrnciar - 0-15 +- Adapt %%pyproject_install not to create a PEP 610 direct_url.json file + * Wed Apr 15 2020 Patrik Kopkan - 0-14 - Add %%pyproject_save_file macro for generating file section - Handle extracting debuginfo from extension modules (#1806625) diff --git a/tests/tldr.spec b/tests/tldr.spec index 9d60fb5..f7bd240 100644 --- a/tests/tldr.spec +++ b/tests/tldr.spec @@ -15,6 +15,7 @@ A Python package containing executables. Building this tests: - there are no bytecompiled files in %%{_bindir} - the executable's shebang is adjusted properly +- file direct_url.json isn't created %prep %autosetup -n %{name}-%{version} @@ -36,6 +37,9 @@ test ! -d %{buildroot}%{_bindir}/__pycache__ # Internal check for our macros: tests we have a proper shebang line head -n1 %{buildroot}%{_bindir}/%{name}.py | grep -E '#!\s*%{python3}\s+%{py3_shbang_opts}\s*$' +# Internal check for our macros: tests that direct_url.json file wasn't created +test ! -e %{buildroot}%{python3_sitelib}/*.dist-info/direct_url.json + %files -f %pyproject_files %license LICENSE %doc README.md