diff --git a/ansible-packaging.spec b/ansible-packaging.spec index 2a9d6e3..50e256d 100644 --- a/ansible-packaging.spec +++ b/ansible-packaging.spec @@ -1,6 +1,6 @@ Name: ansible-packaging Version: 1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: RPM packaging macros and generators for Ansible collections License: GPL-3.0-or-later @@ -30,11 +30,31 @@ BuildArch: noarch %package -n ansible-srpm-macros -Summary: SRPM stage RPM packaging macros for Ansible collections +Summary: SRPM stage RPM packaging macros for Ansible collections %description -n ansible-srpm-macros %{summary}. +%package tests +Summary: Dependencies for Ansible collection package unit tests +Requires: %{name} = %{version}-%{release} +Requires: /usr/bin/ansible-test +# This list is taken from %%{python3_sitelib}/ansible_test/_data/requirements/units.txt +Requires: %{py3_dist pytest} +Requires: %{py3_dist pytest-mock} +Requires: %{py3_dist pytest-xdist} +Requires: %{py3_dist pytest-forked} +Requires: %{py3_dist pyyaml} +# mock is included in the list upstream, but is deprecated in Fedora. +# Maintainers should work with upstream to add compat code to support +# both unittest.mock and mock and/or patch it out themselves. +# See https://fedoraproject.org/wiki/Changes/DeprecatePythonMock. +# Requires: %%{py3_dist mock} + +%description tests +This package contains the necessary dependencies to run unit tests for packaged +Ansible collections + %prep %autosetup -T -c @@ -62,8 +82,19 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} ansible-generator %files -n ansible-srpm-macros %{_rpmmacrodir}/macros.ansible-srpm +# ansible-core in RHEL 8.6 is built against python38. In c8s and the next RHEL +# 8 minor release, it will be built against python39. The testing dependencies +# are not yet packaged for either python version in EPEL 8. +%if ! (%{defined rhel} && 0%{?rhel} < 9) +%files tests +%endif + %changelog +* Mon Aug 01 2022 Maxwell G - 1-7 +- Implement %%ansible_test_unit and add ansible-packaging-tests metapackage. +- Require ansible-core at buildtime + * Wed Jul 20 2022 Fedora Release Engineering - 1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild