public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Marcin Dulak <marcindulak@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/gpaw] rawhide: Use pyproject_install to create bin scripts
Date: Sat, 08 Aug 2026 05:14:43 GMT	[thread overview]
Message-ID: <178616608345.1.1232229523039905210.rpms-gpaw-3009e2032ebf@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/gpaw
Branch : rawhide
Commit : 3009e2032ebf5399c6703ca54988b1e1aee613bd
Author : Marcin Dulak <marcindulak@fedoraproject.org>
Date   : 2026-08-08T05:14:22+00:00
Stats  : +49/-30 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gpaw/c/3009e2032ebf5399c6703ca54988b1e1aee613bd?branch=rawhide

Log:
Use pyproject_install to create bin scripts

---
diff --git a/gpaw b/gpaw
deleted file mode 100755
index 6cc89d2..0000000
--- a/gpaw
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/python3
-
-from gpaw.cli.main import main
-
-main()

diff --git a/gpaw.spec b/gpaw.spec
index 3b6ef31..ce42cfb 100644
--- a/gpaw.spec
+++ b/gpaw.spec
@@ -20,16 +20,13 @@ ExcludeArch: %{ix86}
 
 Name:			gpaw
 Version:		26.7.0
-Release:		2%{?dist}
+Release:		3%{?dist}
 Summary:		A grid-based real-space PAW method DFT code
 
 # Automatically converted from old format: GPLv3+ - review is highly recommended.
 License:		GPL-3.0-or-later
 URL:			https://wiki.fysik.dtu.dk/gpaw/
 Source0:		https://gitlab.com/%{name}/%{name}/-/archive/%{version}/%{name}-%{version}.tar.gz
-# The gpaw script is generated by python setup.py install
-# but this spec does not use install https://gitlab.com/gpaw/gpaw/-/issues/264
-Source1:		gpaw
 
 # https://pagure.io/releng/issue/12359
 BuildRequires:		environment-modules
@@ -134,6 +131,10 @@ sed -i "/^license-files =/d" pyproject.toml
 sed -i  "s|'gpaw-data'||" setup.py
 sed -i  "s|'gpaw-data',||" pyproject.toml
 
+# Remove test failing with pytest-9.1 and higher
+# https://gitlab.com/gpaw/gpaw/-/work_items/1602
+rm -f gpaw/test/test_diagonalizer_backend.py
+
 
 %build
 %set_build_flags
@@ -201,63 +202,83 @@ PYTHON=python3 %dobuild
 %install
 
 # copy python scripts and modules
+# A) bin scripts are generated dynamically by pyproject_install run outside of doinstall
+# See https://gitlab.com/gpaw/gpaw/-/work_items/1605#note_3651215279
+# B) pyproject_install cannot be placed inside of doinstall due to
+# pyproject_extras_subpkg: invalid option -- ','
+# error: Unknown option , in pyproject_extras_subpkg(n:i:f:FaA)
 %global doinstall() \
 mkdir -p $RPM_BUILD_ROOT/$MPI_BIN&& \
-install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT/$MPI_BIN/&& \
+cp -av $TMP_BUILDROOT%{_bindir}/* $RPM_BUILD_ROOT/$MPI_BIN/&& \
 mkdir -p $RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH&& \
-cp -rpv build$MPI_SUFFIX/lib.*/%{name} $RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH/&& \
+cp -av build$MPI_SUFFIX/lib.*/%{name} $RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH/&& \
 install -p -m 755 build$MPI_SUFFIX/lib.*/*.so $RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH/
 
 # install serial version
-PYTHON=python3 MPI_SUFFIX="_serial" MPI_BIN=%{_bindir} MPI_PYTHON3_SITEARCH=%{python3_sitearch} %doinstall
+%global __buildroot_save %{buildroot}
+%global buildroot %{_builddir}/tmp-buildroot
+rm -rfv %{_builddir}/tmp-buildroot
+%{pyproject_install}
+%global buildroot %{__buildroot_save}
+TMP_BUILDROOT=%{_builddir}/tmp-buildroot PYTHON=python3 MPI_SUFFIX="_serial" MPI_BIN=%{_bindir} MPI_PYTHON3_SITEARCH=%{python3_sitearch} %{doinstall}
 
 # install openmpi version
 %{_openmpi_load}
-PYTHON=python3 %doinstall
+%global __buildroot_save %{buildroot}
+%global buildroot %{_builddir}/tmp-buildroot
+rm -rfv %{_builddir}/tmp-buildroot
+%{pyproject_install}
+%global buildroot %{__buildroot_save}
+TMP_BUILDROOT=%{_builddir}/tmp-buildroot PYTHON=python3 %{doinstall}
 %{_openmpi_unload}
 
 # install mpich version
 %{_mpich_load}
-PYTHON=python3 %doinstall
+%global __buildroot_save %{buildroot}
+%global buildroot %{_builddir}/tmp-buildroot
+rm -rfv %{_builddir}/tmp-buildroot
+%{pyproject_install}
+%global buildroot %{__buildroot_save}
+TMP_BUILDROOT=%{_builddir}/tmp-buildroot PYTHON=python3 %{doinstall}
 %{_mpich_unload}
 
 
 %check
 
-export NPROC_PARALLEL=2 # test on 4 cores (scalapack test needs that)
-
+export NPROC_PARALLEL=2 # or test on 4 cores (scalapack test may need that)
 export TIMEOUT_OPTS='--preserve-status --kill-after 10 1800'
 
+# Remove the source directory to avoid duplicate pytest import error
+# ImportError while loading conftest '/builddir/build/BUILD/gpaw-26.7.0-build/gpaw-26.7.0/gpaw/test/conftest.py'.
+# _pytest.pathlib.ImportPathMismatchError: ('gpaw.test.conftest', '/builddir/build/BUILD/gpaw-26.7.0-build/gpaw-26.7.0/build_openmpi/lib.linux-x86_64-cpython-315/gpaw/test/conftest.py', PosixPath('/builddir/build/BUILD/gpaw-26.7.0-build/gpaw-26.7.0/gpaw/test/conftest.py'))
+rm -rfv gpaw
+
 # To avoid replicated code define a macro
 # https://gitlab.com/gpaw/gpaw/-/issues/612
 %global docheck() \
-GPAW_PLATFORM_GLOB=$($PYTHON -c "from distutils import util, sysconfig; print(util.get_platform()+'-*')")&& \
 . /etc/profile.d/gpaw-*.sh&& \
-export PYTHONPATH=$(echo $(pwd)/build$MPI_SUFFIX/lib.${GPAW_PLATFORM_GLOB}) \
-export GPAW_MPI_BACKEND \
-PATH=$RPM_BUILD_ROOT/$MPI_BIN:${PATH} \
-timeout ${TIMEOUT_OPTS} time $GPAW_EXECUTABLE -m ci -v 2>&1 | tee gpaw-test${NPROC}$MPI_SUFFIX.log || true
+export GPAW_MPI_BACKEND&& \
+export PYTHONPATH=$(echo $(pwd)/build$MPI_SUFFIX/lib.*)&& \
+export PATH=$RPM_BUILD_ROOT/$MPI_BIN:${PATH}&& \
+timeout ${TIMEOUT_OPTS} time $GPAW_EXECUTABLE $(echo $(pwd)/build$MPI_SUFFIX/lib.*)/gpaw 2>&1 | tee gpaw-test${NPROC}$MPI_SUFFIX.log || true
 
 # check serial version
-GPAW_MPI_BACKEND=serial MPI_BIN=%{_bindir} MPI_SUFFIX="_serial" PYTHON="python3" GPAW_EXECUTABLE="pytest" NPROC=1 %docheck
-PATH=$RPM_BUILD_ROOT%{_bindir}:${PATH} gpaw test
-
-# How to run a selection of pytest -m ci in parallel?
-# https://gitlab.com/gpaw/gpaw/-/work_items/1605
+GPAW_MPI_BACKEND=serial MPI_BIN=%{_bindir} MPI_SUFFIX="_serial" PYTHON="python3" GPAW_EXECUTABLE="pytest -m ci -v" NPROC=1 %docheck
+PYTHONPATH=$(echo $(pwd)/build_serial/lib.*) PATH=$RPM_BUILD_ROOT%{_bindir}:${PATH} gpaw test
 
 # check openmpi version
 %{_openmpi_load}
-GPAW_MPI_BACKEND=cgpaw PYTHON="python3" GPAW_EXECUTABLE="mpiexec -np 1 pytest" NPROC=${NPROC_PARALLEL} %docheck
-PATH=$RPM_BUILD_ROOT/$MPI_BIN:${PATH} mpiexec -np ${NPROC_PARALLEL} gpaw test
+GPAW_MPI_BACKEND=cgpaw MPI_BIN=$MPI_BIN MPI_SUFFIX=$MPI_SUFFIX PYTHON="python3" GPAW_EXECUTABLE="mpiexec -np ${NPROC_PARALLEL} gpaw python -m pytest -m ci -v" NPROC=${NPROC_PARALLEL} %docheck
+PYTHONPATH=$(echo $(pwd)/build$MPI_SUFFIX/lib.*) PATH=$RPM_BUILD_ROOT/$MPI_BIN:${PATH} mpiexec -np ${NPROC_PARALLEL} gpaw test
 %{_openmpi_unload}
 
 # check mpich version
 %{_mpich_load}
-GPAW_MPI_BACKEND=cgpaw PYTHON="python3" GPAW_EXECUTABLE="mpiexec -np 1 pytest" NPROC=${NPROC_PARALLEL} %docheck
+GPAW_MPI_BACKEND=cgpaw MPI_BIN=$MPI_BIN MPI_SUFFIX=$MPI_SUFFIX PYTHON="python3" GPAW_EXECUTABLE="mpiexec -np ${NPROC_PARALLEL} gpaw python -m pytest -m ci -v" NPROC=${NPROC_PARALLEL} %docheck
 # Exclude tests on f42 onwards
 # Fatal error in internal_Bcast
 %ifnarch s390x
-PATH=$RPM_BUILD_ROOT/$MPI_BIN:${PATH} mpiexec -np ${NPROC_PARALLEL} gpaw test
+PYTHONPATH=$(echo $(pwd)/build$MPI_SUFFIX/lib.*) PATH=$RPM_BUILD_ROOT/$MPI_BIN:${PATH} mpiexec -np ${NPROC_PARALLEL} gpaw test
 %endif
 %{_mpich_unload}
 
@@ -286,6 +307,9 @@ PATH=$RPM_BUILD_ROOT/$MPI_BIN:${PATH} mpiexec -np ${NPROC_PARALLEL} gpaw test
 
 
 %changelog
+* Thu Aug 06 2026 Marcin Dulak <marcindulak@fedoraproject.org> - 26.7.0-3
+- Use pyproject_install to create bin scripts
+
 * Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 26.7.0-2
 - Rebuilt for Python 3.15.0b4 ABI change
 

                 reply	other threads:[~2026-08-08  5:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178616608345.1.1232229523039905210.rpms-gpaw-3009e2032ebf@fedoraproject.org \
    --to=marcindulak@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox