public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ddiskit] rawhide: spec: switch to the pyproject macros
@ 2026-09-24 10:28 Oleksii Baranov
  0 siblings, 0 replies; only message in thread
From: Oleksii Baranov @ 2026-09-24 10:28 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/ddiskit
            Branch : rawhide
            Commit : 46bb0dfc5ddd4c01280cbd4a860b390b4222413e
            Author : Oleksii Baranov <olebaran@redhat.com>
            Date   : 2026-09-01T15:41:39+02:00
            Stats  : +44/-13 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/ddiskit/c/46bb0dfc5ddd4c01280cbd4a860b390b4222413e?branch=rawhide

            Log:
            spec: switch to the pyproject macros

Spec is switched to the new pyproject macros instead of deprecated
py3_*. Also added check section to run pytest tests.

Config and other data files are now installed using spec install into
the system /usr/share/ddiskit/.

This change depends on the upstream MRs:
- https://gitlab.com/redhat/centos-stream/src/dup/ddiskit/-/merge_requests/1
- https://gitlab.com/redhat/centos-stream/src/dup/ddiskit/-/merge_requests/2

Signed-off-by: Oleksii Baranov <olebaran@redhat.com>

---
diff --git a/.gitignore b/.gitignore
index 3f4d7f3..d886a20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 /ddiskit-3.6.tar.gz
 /ddiskit-de1f6847223085dcdd177e02a7298c835fae12a3.tar.gz
 /ddiskit-d857c7726fd55e613bbd7af6c842ddfc80a9fdc8.tar.bz2
+/ddiskit-82d44fc79582396cf634f6e1ac4edb06688ea524.tar.bz2

diff --git a/ddiskit.spec b/ddiskit.spec
index d79cae1..38b571d 100644
--- a/ddiskit.spec
+++ b/ddiskit.spec
@@ -1,17 +1,17 @@
 # Use the forge macros to simplify packaging.
-# See https://fedoraproject.org/wiki/Forge-hosted_projects_packaging_automation 
+# See https://fedoraproject.org/wiki/Forge-hosted_projects_packaging_automation
 %global forgeurl https://gitlab.com/redhat/centos-stream/src/dup/ddiskit
-# When we no longer need to build against a git commit, 
+# When we no longer need to build against a git commit,
 # Simply remove the commit variable and update the Version
 # Then forge will pick up the release
-%global commit d857c7726fd55e613bbd7af6c842ddfc80a9fdc8
+%global commit 82d44fc79582396cf634f6e1ac4edb06688ea524
 
 Name:           ddiskit
 Version:        3.6
 
 %forgemeta
 
-Release:        35%{?dist}
+Release:        36%{?dist}
 Summary:        Tool for Red Hat Enterprise Linux Driver Update Disk creation
 
 License:        GPL-3.0-only
@@ -20,7 +20,6 @@ Source0:        %{forgesource}
 
 BuildArch:      noarch
 BuildRequires:  python3-devel
-BuildRequires:  python3-setuptools
 
 Requires:       rpm createrepo
 Requires:       /usr/bin/mkisofs
@@ -35,21 +34,44 @@ kernel modules.
 
 %prep
 %forgesetup
-# Fix build with setuptools 62.1
-# https://github.com/orosp/ddiskit/issues/17
-sed -i "8i packages=[]," setup.py
+
+%generate_buildrequires
+%pyproject_buildrequires -x test
 
 %build
-%py3_build
+%pyproject_wheel
 
 %install
-%py3_install
+%pyproject_install
+# Resource files are bundled as package data in python3_sitelib/ddiskit/
+# but also installed to system paths for conventional system-wide use
+install -Dpm 0644 src/ddiskit/ddiskit.config \
+    %{buildroot}%{_datadir}/ddiskit/ddiskit.config
+install -Dpm 0644 src/ddiskit/templates/spec \
+    %{buildroot}%{_datadir}/ddiskit/templates/spec
+install -pm 0644 src/ddiskit/templates/config \
+    %{buildroot}%{_datadir}/ddiskit/templates/config
+install -Dpm 0644 src/ddiskit/profiles/default \
+    %{buildroot}%{_datadir}/ddiskit/profiles/default
+install -pm 0644 src/ddiskit/profiles/rh-testing \
+    %{buildroot}%{_datadir}/ddiskit/profiles/rh-testing
+install -pm 0644 src/ddiskit/profiles/rh-release \
+    %{buildroot}%{_datadir}/ddiskit/profiles/rh-release
+install -Dpm 0644 src/ddiskit/keyrings/rh-release/fd431d51.key \
+    %{buildroot}%{_datadir}/ddiskit/keyrings/rh-release/fd431d51.key
+install -Dpm 0644 src/ddiskit/etc/ddiskit.config \
+    %{buildroot}%{_sysconfdir}/ddiskit.config
+install -Dpm 0644 ddiskit.1 \
+    %{buildroot}%{_mandir}/man1/ddiskit.1
+install -Dpm 0644 ddiskit \
+    %{buildroot}%{_datadir}/bash-completion/completions/ddiskit
 find %{buildroot} -size 0 -delete
 
 %files -n %{name}
 %doc README
 %license COPYING
-%{python3_sitelib}/ddiskit-*.egg-info
+%{python3_sitelib}/ddiskit/
+%{python3_sitelib}/ddiskit-*.dist-info
 %{_bindir}/ddiskit
 %{_mandir}/man1/ddiskit.1*
 %{_datadir}/bash-completion/completions/ddiskit
@@ -67,7 +89,16 @@ find %{buildroot} -size 0 -delete
 
 %config(noreplace) /etc/ddiskit.config
 
+%check
+%pytest
+
 %changelog
+* Fri Jul 31 2026 Oleksii Baranov <olebaran@redhat.com> - 3.6-36
+- Migrate to pyproject.toml, restructure as proper Python package
+- Drop deprecated setup.py and data_files, install data files explicitly
+- Bundle resource files as package data for editable/dev installs
+- Add GitLab CI pipeline with pytest happy-path tests
+
 * Wed Jul 15 2026 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-35
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 
@@ -197,4 +228,3 @@ Resolves: rhbz#2319624
 
 * Mon Sep 5 2016 Petr Oros <poros@redhat.com> - 3.0-1
 - Initial package.
-

diff --git a/sources b/sources
index 54ca25b..71c8714 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (ddiskit-d857c7726fd55e613bbd7af6c842ddfc80a9fdc8.tar.bz2) = 26495400e943b8cee2c14bcf0b25318622514f244de0bdf85adedfdf48054288b06ea8e6f642f43ae19c9775ab5e1cd371ad86fa509c782d0ad116e8d777e303
+SHA512 (ddiskit-82d44fc79582396cf634f6e1ac4edb06688ea524.tar.bz2) = 847889e0a941c4056745be8c0977cf4a9cb988c888ed7dd8a54352ae908d0cbfe09c4158d70351a4279583f8ec2b94d5c6f3f9a1cf6a4031a01dc0a88760d130

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-24 10:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 10:28 [rpms/ddiskit] rawhide: spec: switch to the pyproject macros Oleksii Baranov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox