public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedpkg] 1.48-1: Switch to %pyproject_* macros
@ 2026-08-10 21:46 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10 21:46 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fedpkg
            Branch : 1.48-1
            Commit : 8071b4dac1ba103390a297d741a05aed070e7756
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2025-06-24T03:05:07+02:00
            Stats  : +59/-73 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedpkg/c/8071b4dac1ba103390a297d741a05aed070e7756?branch=1.48-1

            Log:
            Switch to %pyproject_* macros

* drop the setuptools support except python3.6 (epel8)
* new recommended subpackage fedpkg-completion which enables python
  argcomplete

JIRA: RHELCMP-14593

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
diff --git a/0001-Do-not-use-pytest-related-dependencies-temporarily.patch b/0001-Do-not-use-pytest-related-dependencies-temporarily.patch
deleted file mode 100644
index 4b52e9b..0000000
--- a/0001-Do-not-use-pytest-related-dependencies-temporarily.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From f977b49afd95262127bc17131d81b18eeaaad929 Mon Sep 17 00:00:00 2001
-From: Ondrej Nosek <onosek@redhat.com>
-Date: Wed, 9 Sep 2020 03:20:15 +0200
-Subject: [PATCH] Do not use pytest-related dependencies temporarily
-
-Signed-off-by: Ondrej Nosek <onosek@redhat.com>
----
- setup.py | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index 2b1d1fd..40c5cbe 100755
---- a/setup.py
-+++ b/setup.py
-@@ -54,7 +54,6 @@ setup(
-                 ('/usr/share/zsh/site-functions', ['conf/zsh-completion/_fedpkg']),
-                 ],
- 
--    setup_requires=['pytest-runner'],
-     install_requires=install_requires,
-     tests_require=tests_require,
- 
--- 
-2.26.2
-

diff --git a/0002-Remove-pytest-coverage-execution.patch b/0002-Remove-pytest-coverage-execution.patch
deleted file mode 100644
index fc17760..0000000
--- a/0002-Remove-pytest-coverage-execution.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 926e903db635d6e4f5dad1f0c16d9e45e097f4d6 Mon Sep 17 00:00:00 2001
-From: Ondrej Nosek <onosek@redhat.com>
-Date: Mon, 7 Feb 2022 01:26:53 +0100
-Subject: [PATCH] Remove pytest coverage execution
-
-Signed-off-by: Ondrej Nosek <onosek@redhat.com>
----
- setup.cfg | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/setup.cfg b/setup.cfg
-index c952275..3c47304 100644
---- a/setup.cfg
-+++ b/setup.cfg
-@@ -5,10 +5,6 @@ test = pytest
- formats = bztar
- 
- [tool:pytest]
--# additional values for 'addopts' can be:
--# --cov-report html
--# -ra -q
--addopts = --cov=fedpkg
- testpaths = test
- 
- [flake8]
--- 
-2.34.1
-

diff --git a/fedpkg.spec b/fedpkg.spec
index 4a5dee7..0c9d517 100644
--- a/fedpkg.spec
+++ b/fedpkg.spec
@@ -1,6 +1,7 @@
-%define compdir %(pkg-config --variable=completionsdir bash-completion)
-%if "%{compdir}" == ""
-%define compdir "/etc/bash_completion.d"
+%define bash_completion_dir %{_datadir}/bash-completion/completions
+
+%if 0%{?rhel} == 8
+%define legacy_system 1
 %endif
 
 Name:           fedpkg
@@ -14,8 +15,7 @@ URL:            https://pagure.io/fedpkg
 Source0:        https://pagure.io/releases/fedpkg/%{name}-%{version}.tar.gz
 
 BuildArch:      noarch
-Patch1:         0001-Do-not-use-pytest-related-dependencies-temporarily.patch
-Patch2:         0002-Remove-pytest-coverage-execution.patch
+
 
 BuildRequires:  pkgconfig
 BuildRequires:  bash-completion
@@ -30,9 +30,14 @@ Requires:       redhat-rpm-config
 BuildRequires:  python3-devel
 BuildRequires:  python3-rpkg >= 1.68-1
 BuildRequires:  python3-distro
+%if !%{defined legacy_system}
+BuildRequires:  python3-hatchling
+%endif
 # For testing
 BuildRequires:  python3-pytest
+%if %{defined legacy_system}
 BuildRequires:  python3-setuptools
+%endif
 BuildRequires:  python3-bugzilla
 BuildRequires:  python3-freezegun
 BuildRequires:  python3-bodhi-client
@@ -43,8 +48,11 @@ Requires:       python3-rpkg >= 1.68-1
 Requires:       python3-distro
 Requires:       python3-openidc-client >= 0.6.0
 Requires:       python3-bodhi-client
+%if %{defined legacy_system}
 Requires:       python3-setuptools
+%endif
 Recommends:     fedora-packager
+Recommends:     fedpkg-completion
 
 
 %description
@@ -57,45 +65,76 @@ Requires:       %{name} = %{version}-%{release}
 %description    -n fedpkg-stage
 Provides the fedpkg command for working with dist-git
 
+%package        -n fedpkg-completion
+Summary:        The command-line completion support for fedpkg based on python-argcomplete
+Requires:       %{name} = %{version}-%{release}
+
+%description    -n fedpkg-completion
+This subpackage provides the command-line completion for the fedpkg CLI
+via the python-argcomplete framework.
+
 %prep
 %autosetup -p1
 
+%if !%{defined legacy_system}
+%generate_buildrequires
+%pyproject_buildrequires
+%endif
+
 %build
+%if %{defined legacy_system}
 %py_build
-%{__python} doc/fedpkg_man_page.py > fedpkg.1
-
+%else
+%pyproject_wheel
+%endif
+%{python3} doc/fedpkg_man_page.py > fedpkg.1
 
 %install
+%if %{defined legacy_system}
 %py_install
+%else
+%pyproject_install
+%pyproject_save_files -l %{name}
+%endif
 %{__install} -d %{buildroot}%{_mandir}/man1
 %{__install} -p -m 0644 fedpkg.1 %{buildroot}%{_mandir}/man1
-%if 0%{?rhel} && 0%{?rhel} == 7
-# The completion file must be named similarly to the command.
-mv %{buildroot}%{compdir}/fedpkg.bash %{buildroot}%{compdir}/fedpkg
+echo "register-python-argcomplete fedpkg" > fedpkg.bash
+%{__install} -d %{buildroot}%{bash_completion_dir}
+%{__install} -p -m 0644 fedpkg.bash %{buildroot}%{bash_completion_dir}
+%if !%{defined legacy_system}
+# config file /etc/rpkg/fedpkg.conf is extracted to %{buildroot}/usr/etc/... by pyproject_install
+%{__install} -d %{buildroot}%{_sysconfdir}
+mv %{buildroot}/usr/etc/* %{buildroot}%{_sysconfdir}
 %endif
 
-
 %check
+%if !%{defined legacy_system}
+%pyproject_check_import
+%endif
 %pytest
 
 
+%if %{defined legacy_system}
 %files
-%doc README.rst CHANGELOG.rst
+# For noarch packages: sitelib
+%{python3_sitelib}/%{name}
+%{python3_sitelib}/%{name}-%{version}-py*.egg-info
+%else
+%files -f %{pyproject_files}
+%endif
 %license COPYING
+%doc README.rst CONTRIBUTING.md CHANGELOG.rst
 %config(noreplace) %{_sysconfdir}/rpkg/fedpkg.conf
-%(dirname %{compdir})
 %{_bindir}/%{name}
 %{_mandir}/*/*
-# For noarch packages: sitelib
-%{python3_sitelib}/%{name}
-%{python3_sitelib}/%{name}-%{version}-py*.egg-info
-# zsh completion
-%{_datadir}/zsh/site-functions/_%{name}
 
-%files  stage
+%files -n fedpkg-stage
 %{_bindir}/%{name}-stage
 %config(noreplace) %{_sysconfdir}/rpkg/fedpkg-stage.conf
 
+%files -n fedpkg-completion
+%config(noreplace) %{bash_completion_dir}/fedpkg.bash
+
 
 %changelog
 * Wed Jun 04 2025 Python Maint <python-maint@redhat.com> - 1.46-2

diff --git a/sources b/sources
index fdeb849..b524249 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (fedpkg-1.46.tar.gz) = 7820d345afd66c7aec65f8f8c41dc797ed3df953256b98bb5c7bdf769ae04bf6d74b946287d38769d2fdfb856ffb5edb74d356ef36490c8df86bc6ecb909f935
+SHA512 (fedpkg-1.46.tar.gz) = be437cfcf10137180f296fd796202f1174e1cc6be6f9ae95bdf9652a9c68486b73f8892070e77065e0d6d762ea2bb317ff2554d24ae6c6cdd7e3dacc65b3bb6c

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

only message in thread, other threads:[~2026-08-10 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 21:46 [rpms/fedpkg] 1.48-1: Switch to %pyproject_* macros 

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